From 8702b1c28ddbd1b8b84f5705b0a44cafc76393dc Mon Sep 17 00:00:00 2001 From: Steph Date: Thu, 1 Dec 2022 21:01:59 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20First=20star!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2020/1/input | 200 +++++++++++++++++++++++++++++++++++++++++++++++ 2020/1/report.py | 29 +++++++ 2 files changed, 229 insertions(+) create mode 100644 2020/1/input create mode 100755 2020/1/report.py diff --git a/2020/1/input b/2020/1/input new file mode 100644 index 0000000..c9d1743 --- /dev/null +++ b/2020/1/input @@ -0,0 +1,200 @@ +1934 +1702 +1571 +1737 +1977 +1531 +1428 +1695 +1794 +1101 +13 +1164 +1235 +1289 +1736 +1814 +1363 +1147 +1111 +1431 +1765 +1515 +1184 +1036 +1803 +1791 +1638 +1809 +1283 +1980 +1854 +1878 +1574 +1352 +1151 +730 +1581 +1990 +1919 +2003 +1538 +1663 +1735 +1772 +1830 +1152 +1022 +1774 +1544 +1551 +1835 +1383 +1614 +1396 +1715 +1530 +295 +1208 +1978 +1104 +1691 +1176 +1183 +1909 +1192 +1535 +1924 +1268 +1969 +1954 +1760 +1077 +1734 +1371 +1676 +1933 +1400 +1928 +1982 +1541 +1106 +1248 +1346 +1782 +1142 +1849 +1798 +1362 +1379 +1886 +1265 +1226 +1751 +1575 +1027 +1710 +1601 +1205 +1922 +1452 +1206 +1263 +2000 +1957 +1951 +1834 +1533 +1149 +1245 +1564 +1182 +1237 +1013 +1254 +1895 +1504 +1480 +1556 +1821 +1589 +1864 +1573 +1698 +1927 +1434 +516 +1722 +1360 +1940 +1212 +1329 +1675 +1812 +1917 +1302 +1604 +1336 +1233 +1405 +1179 +1169 +1081 +1941 +1553 +1236 +1824 +1923 +1938 +1475 +1446 +1545 +1853 +1664 +317 +1489 +1884 +1743 +1621 +1128 +1474 +1505 +394 +1387 +1509 +1627 +1914 +1913 +1949 +1843 +1847 +1882 +1486 +1082 +1802 +1645 +1690 +1629 +1377 +2004 +1044 +1191 +1014 +1857 +1813 +1572 +1055 +1002 +1721 +1273 +1417 +1968 +1888 +1863 +1278 +1141 +1964 +1259 +1823 +1181 +1779 diff --git a/2020/1/report.py b/2020/1/report.py new file mode 100755 index 0000000..8340699 --- /dev/null +++ b/2020/1/report.py @@ -0,0 +1,29 @@ +#!/usr/bin/python3 + +# Hmm yes, pythonian +# This makes me want to say bad things + +filename = "input" + +with open(filename, "r") as f: + lines = f.read() + lines = lines.split() + + for numa in lines: + numa = int(numa) + + for numb in lines: + numb = int(numb) + + if numa + numb != 2020: + continue + + product = numa * numb + print(numa, numb, product) + + break + + else: + continue + + break