rename repo, subdir for yearly challenges

This commit is contained in:
2021-07-25 11:17:46 +02:00
parent 1806f79e14
commit 4a2318edc9
203 changed files with 212 additions and 1 deletions

957
2020/day04/INPUT.txt Normal file
View File

@@ -0,0 +1,957 @@
byr:1971
iyr:2017 hgt:160cm
eyr:2020 ecl:hzl
pid:157096267
hgt:183cm
pid:368895060
ecl:oth eyr:2020
iyr:2013
byr:1966
ecl:lzr cid:279 pid:192cm
hcl:1f7352 iyr:2014 hgt:70cm eyr:1983
byr:2004
hcl:#602927 iyr:2018 byr:1938 ecl:blu
eyr:2024 hgt:172cm
pid:839621424
ecl:#12f268
hcl:#6b5442
iyr:2012 byr:2011
eyr:1933 pid:189cm hgt:155in
byr:1954
ecl:gry pid:664227667 eyr:2028
hgt:151cm
iyr:2019
ecl:gry
byr:1931 iyr:2017
pid:459927933 eyr:2028
hgt:67in hcl:#fffffd
cid:322 hgt:163cm
byr:1969 hcl:#a97842 pid:472877556
iyr:2019
ecl:amb eyr:2030
hcl:#733820 ecl:brn byr:2000 eyr:2022 iyr:2014 cid:320 pid:751634349
hgt:180cm
ecl:blu eyr:2028
hcl:#866857 byr:2029 hgt:191cm iyr:2010
pid:170cm cid:123
pid:258660154 byr:1921 hgt:161cm
eyr:2030
cid:217 iyr:2012
hcl:#4dd6d4 ecl:grn
hgt:170cm byr:1978 eyr:2022 pid:399347273
iyr:2010 cid:109 ecl:blu hcl:#602927
pid:172106685
hgt:183cm
ecl:gry iyr:2020 eyr:2025 hcl:#18171d byr:1980 cid:289
cid:77 ecl:#254ad9
byr:2017 pid:169290741 iyr:2003 hgt:85 hcl:z
hgt:155cm byr:1987 ecl:oth hcl:#fffffd
iyr:2010
ecl:brn iyr:2014 cid:74
hcl:#623a2f
hgt:187cm byr:1955 pid:008305281 eyr:2025
pid:428624233 ecl:grn
eyr:2027 hgt:167cm hcl:#623a2f byr:1960 iyr:2016
eyr:2027 pid:358876826 hgt:171cm ecl:oth byr:1957 iyr:2018
hcl:#ceb3a1
cid:314
ecl:grn eyr:2030
hgt:73in iyr:2011 hcl:#602927
hgt:76in byr:2029
pid:2703176 iyr:2020
eyr:2037 ecl:#95d926
hcl:9574d2
eyr:2020 hgt:164cm
byr:1949 hcl:#fffffd pid:591281293 iyr:2014 cid:136
cid:268 hgt:73in hcl:#6b5442 eyr:2025 ecl:brn byr:1988 pid:899417027 iyr:2015
iyr:2020 hcl:#b6652a hgt:177cm
eyr:2028 ecl:hzl
byr:1995 pid:594197202
hcl:#a97842 hgt:179cm byr:1930
ecl:brn pid:010268954 eyr:2020 iyr:2010
iyr:2022 pid:93390086
cid:321 eyr:2034 hcl:#a97842 hgt:168in byr:2006 ecl:#a8f84c
eyr:2028 ecl:blu byr:1935
hcl:#6b5442 pid:187679418
hgt:174cm iyr:2016
iyr:2019 hgt:164cm pid:704379775
ecl:oth hcl:#888785 byr:1930
eyr:2025
hcl:#6b5442 cid:168
hgt:171cm eyr:1944 iyr:2018 pid:675364934
byr:1962
ecl:hzl
hcl:z
eyr:2039
ecl:zzz pid:26281402 cid:144 iyr:1928
hgt:166cm
ecl:hzl hcl:#7d3b0c
eyr:2022 pid:011589584
hgt:64in byr:1945 iyr:2014
byr:1950 hcl:#18171d pid:685748669 eyr:2028 iyr:2010 hgt:176cm ecl:grn
byr:1989
hgt:163cm hcl:#18171d ecl:grn iyr:2020 pid:721397788 cid:308 eyr:2020
pid:443496560 iyr:1999
eyr:2027 hcl:z
hgt:69in ecl:zzz byr:2019
cid:108
pid:#c9d804 eyr:2011
ecl:#574df9 iyr:2027 hcl:z byr:2018
hgt:64
hgt:69cm
iyr:1926 hcl:fdcce6
ecl:#28b358
eyr:2026
byr:1994
pid:76404593
eyr:2020
ecl:hzl pid:978839539 hcl:#efcc98
byr:1935 cid:121
hgt:165cm
ecl:amb
byr:1951 hgt:186cm pid:812513486 iyr:2012 eyr:2029 hcl:#fffffd
hcl:fcdd61 hgt:168in ecl:grt pid:8474140699 byr:1924 iyr:2027 eyr:2023
ecl:oth hcl:#866857
byr:1965 pid:533941934 hgt:166cm iyr:2019 eyr:2040
eyr:2032 pid:0795438812 iyr:2009 hcl:z
byr:2028 hgt:131 ecl:gmt
cid:102 byr:1923 eyr:2025
pid:222102208 iyr:2019 hcl:#341e13
hgt:167cm
ecl:amb
hgt:180cm byr:1956 iyr:2014 eyr:2022
ecl:oth cid:175 hcl:#888785
cid:216 eyr:2022
ecl:brn pid:002875069 iyr:2019 hcl:#cfa07d byr:1991 hgt:164cm
iyr:2014 byr:1933 pid:537809907
hgt:185cm eyr:2029 hcl:#341e13 ecl:blu
cid:286 hgt:166cm byr:1977 iyr:2012 pid:541909675 ecl:oth eyr:2020
hcl:#59eb12
hcl:#18171d cid:329 byr:1921 eyr:2027 iyr:2019
pid:440820443 hgt:75in ecl:blu
hcl:#733820 hgt:177cm
pid:085529831 eyr:2029 iyr:2010 ecl:amb byr:1972
pid:704125918 hcl:#b6652a byr:1981
ecl:#698ae8 cid:141 iyr:2018 eyr:2026 hgt:66in
iyr:2020 eyr:2022
hgt:191cm hcl:#7d3b0c
ecl:blu byr:1943 pid:969407635
pid:10899196
hgt:161cm
ecl:lzr iyr:2023 hcl:#ceb3a1 byr:1986 eyr:2012
hcl:#7d3b0c ecl:utc eyr:2020
byr:2028 pid:#f8c441 iyr:2030
hgt:164cm
byr:2003 hcl:z iyr:2012 hgt:187in
ecl:gry eyr:2030 pid:150cm
pid:427618420 hgt:155cm iyr:2012
ecl:brn
byr:1948 eyr:2029 hcl:#6b5442
ecl:oth hgt:81
byr:2025 cid:66 pid:174cm hcl:z
eyr:2021
byr:2027 ecl:lzr hcl:#888785 eyr:1923 hgt:110 cid:54 iyr:1939
hcl:#341e13 byr:1961 eyr:2022 hgt:163cm cid:137 ecl:amb
iyr:2019
hcl:#866857
iyr:2020
byr:2005
hgt:139 ecl:amb cid:181
eyr:2016
pid:181cm
byr:2030
iyr:2014
hcl:#733820 cid:74 eyr:2021 hgt:179cm
pid:7938817872
ecl:amb
hcl:91a6dd
iyr:2019 byr:2024
hgt:72cm
ecl:gmt eyr:2023
pid:8440093771
ecl:grn byr:1963 cid:60 iyr:2030
hgt:74 eyr:2022
pid:193189388
hcl:#b6652a
pid:403849590 byr:2012
eyr:1951 cid:90 iyr:2023
hgt:69cm hcl:z ecl:gmt
iyr:2010 hcl:#341e13
pid:011326174 hgt:185cm byr:1976 cid:207 eyr:2027 ecl:amb
hgt:64in
pid:499837104 hcl:#3be285
byr:1944
eyr:2024 iyr:2017
ecl:gry
eyr:2032 pid:#850d4e hcl:deddda ecl:brn hgt:172 byr:2004
cid:244 iyr:2022
hcl:a3346d ecl:amb
pid:#505713 hgt:74cm eyr:2010 iyr:2020
byr:1987
ecl:oth iyr:2012 eyr:2023
pid:131199420 cid:112 hcl:#a97842
cid:256 hcl:#a97842 byr:2000 iyr:2018 ecl:oth
eyr:2022 pid:637777693 hgt:160cm
hgt:152cm
cid:164 hcl:#866857 ecl:grn eyr:2025
pid:495224989 iyr:2020 byr:1949
iyr:2010
cid:288 byr:1986 ecl:blu
pid:304077824
eyr:2020
hgt:182cm
ecl:blu
hcl:#18171d pid:047931925 byr:1964
iyr:2012 eyr:2030 cid:167
byr:1958
hcl:#866857 iyr:2019 hgt:165cm pid:553631683
cid:109 ecl:gry
eyr:2023
cid:156
iyr:2014 pid:811368482 eyr:2026 hcl:#b6652a byr:1994
hgt:184cm ecl:brn
hcl:#733820
hgt:183cm ecl:grn
pid:265625165 byr:1943 cid:344
iyr:2011
iyr:2017 hcl:#c0946f pid:716422629 cid:104 byr:1974
hgt:160cm eyr:2021 ecl:brn
byr:2002 hgt:180cm hcl:#602927
eyr:2025 ecl:grn iyr:2011 pid:887584172
hcl:#888785 ecl:brn eyr:2026
pid:14483306 byr:1947
hgt:177cm iyr:2015
hcl:#b6652a
ecl:#64783e eyr:2020 hgt:163 pid:651615946
iyr:2012 byr:1999
iyr:2014 ecl:gry hgt:188cm eyr:2028 pid:503058612 hcl:#a31066
hgt:178cm hcl:z
ecl:amb
pid:17656631
eyr:2031 byr:2023
hgt:166cm pid:783568747 hcl:#341e13
byr:1955 ecl:grn eyr:2023
iyr:2016 hgt:161cm byr:1989
eyr:2023
ecl:amb pid:133770783
hcl:#fffffd
cid:75 byr:1986 eyr:2020 pid:099478576 ecl:blu
hcl:#733820
iyr:2011 hgt:158cm
pid:911200183 hcl:#602927 eyr:2029 iyr:2018 ecl:brn hgt:181cm
byr:1937
iyr:1928 byr:2020 hcl:579202
hgt:60 ecl:utc eyr:1963 pid:157cm
cid:253
eyr:2028 iyr:1949
pid:284455762 hcl:#a97842 ecl:oth byr:1947 hgt:163cm
hcl:#18171d eyr:2025 cid:222
byr:1924 ecl:oth
pid:898594506 hgt:182cm
iyr:2017
byr:1935 iyr:2027
hgt:160in pid:#c090c3
hcl:#623a2f cid:162 eyr:1942 ecl:amb
iyr:2014 hgt:160cm eyr:2028 hcl:#623a2f byr:2010
pid:684765216 ecl:blu
byr:1958
hgt:154cm hcl:#a97842
ecl:oth iyr:2015 eyr:2020 cid:334
pid:636691339 iyr:2018
byr:1930
hcl:#b6652a cid:86
hgt:184cm ecl:oth
eyr:2029
iyr:2025
hgt:76cm ecl:#043004 hcl:z
byr:2009 eyr:1999
eyr:2020 pid:56419390 iyr:2015 hcl:#ceb3a1 ecl:utc
hgt:98
iyr:2014 byr:1927 hcl:#fffffd ecl:amb eyr:2022
hgt:188cm pid:602778565
hcl:#cfa07d eyr:2029 byr:1937 pid:7912057436
ecl:hzl
cid:192 hgt:68in iyr:2012
hgt:155cm
iyr:2015 byr:1954 pid:559203670
ecl:blu hcl:#fffffd eyr:2025
hcl:#341e13 byr:1998 iyr:2019
cid:312
ecl:oth
pid:230874778 hgt:161cm
iyr:2011 ecl:amb
eyr:2026
hgt:163cm byr:1932 hcl:#733820 pid:850176278
eyr:2030
hgt:170cm
iyr:2017 byr:1972
pid:014731313
hcl:#341e13 ecl:brn
pid:133005637
hgt:167cm
cid:317
eyr:2025 hcl:#341e13 iyr:2012 ecl:gry byr:1950
iyr:2029 pid:745014772 hgt:68in
eyr:2034 ecl:hzl
hcl:ec07ce
hgt:165cm
ecl:gry
hcl:#a97842 byr:1921 cid:263 pid:609363367
pid:192cm hcl:18f308
ecl:oth
eyr:2037 cid:239 iyr:2026 byr:2010
hcl:d0e525 eyr:2037 iyr:2019
cid:197
pid:469740743
hgt:186in ecl:brn byr:1977
ecl:hzl cid:254 hgt:165cm
eyr:2024 byr:1996
iyr:2021 pid:797277746 hcl:e286e8
hcl:#b6652a cid:142 ecl:oth hgt:190cm byr:1962 pid:997137384 iyr:2020
eyr:2029
ecl:brn byr:1962 hcl:#866857 iyr:2020 hgt:152cm pid:701556397 cid:121 eyr:2029
eyr:2024 cid:186 hcl:z
byr:1962 hgt:155cm pid:448098321 iyr:2017 ecl:grn
iyr:2016
hgt:168cm byr:1999
cid:286
hcl:#18171d pid:223995430 eyr:2022 ecl:blu
pid:227780276 ecl:blu iyr:2017 byr:1985 hcl:#6b5442 hgt:183cm eyr:2028
hgt:190cm
ecl:oth eyr:2030 cid:223 hcl:#888785 iyr:2010
pid:115829664 byr:1967
eyr:1992 pid:0688674980 hcl:z
byr:2028
hgt:186in ecl:#849f7b
iyr:2029
cid:64
eyr:2025
iyr:2013 byr:1958 ecl:grn
hcl:#ceb3a1
hgt:153cm pid:815357118
pid:038013822 hgt:180cm iyr:2013
hcl:#623a2f
ecl:grn eyr:2029 byr:1949
byr:1923
cid:299 hgt:184cm iyr:2020
hcl:#fffffd eyr:2027
ecl:hzl
byr:1930
iyr:2012
ecl:grn hcl:#87f2c8 pid:787371085
iyr:2019
eyr:2028 pid:107626362 hgt:183cm
ecl:grt hcl:#623a2f byr:1985
byr:2011
hgt:68in iyr:2002 ecl:#5dfa18 hcl:#341e13 pid:205853974
iyr:2014
pid:179cm
hcl:13b9e3 eyr:2022 ecl:#b1759b hgt:184in
byr:1954
hgt:183cm hcl:#efcc98
pid:428260080 cid:231 eyr:2025 ecl:grn
iyr:2010
byr:1957
iyr:2016
ecl:gry
pid:192cm eyr:2026
byr:1956
hgt:174cm hcl:#623a2f
eyr:2021 ecl:blu cid:230
byr:1923
pid:438732879 hgt:167cm
hcl:#602927
byr:1948 ecl:xry
pid:154cm hgt:179cm eyr:2029 iyr:2017
hcl:#dd59ab
hcl:#ceb3a1
iyr:2014 byr:1981 hgt:167cm ecl:grn
eyr:2021
pid:926925947
iyr:1985
pid:652196636 hcl:#18171d ecl:#ff3e10 hgt:162cm byr:2012 eyr:2023 cid:171
eyr:2029
hgt:166cm
pid:499909488 byr:1929 hcl:#866857 ecl:brn iyr:2013
pid:440245122
byr:1992 hgt:179cm iyr:2010 cid:181 ecl:brn hcl:#888785 eyr:2020
eyr:2029 hcl:#888785 pid:274994154 ecl:hzl
iyr:2014 byr:1995
pid:3195072620
hcl:z ecl:hzl cid:130 iyr:2030 eyr:2034 hgt:157
hcl:#1b0a51
pid:129985083 eyr:2029
hgt:192cm cid:236 byr:1996 ecl:blu iyr:2016
ecl:lzr pid:899902347 iyr:1982
hcl:#cfa07d eyr:2028 byr:1927 hgt:155in
cid:187 eyr:2029 hcl:#efcc98 byr:1986 pid:760318090
hgt:169cm iyr:2018 ecl:amb
hcl:#fffffd eyr:2021 pid:532530085 iyr:2019 byr:1995 hgt:169cm
iyr:1980
hcl:z eyr:2019
hgt:72cm pid:6532875244 ecl:#2f2221 byr:2006
hgt:174cm byr:1920
ecl:gry pid:#14fae7 eyr:2026 hcl:#1814d1
iyr:2013
hcl:#ceb3a1 ecl:grn
iyr:2018
byr:1978
hgt:183cm pid:566862236
eyr:2028
iyr:2020 ecl:amb
pid:618246345 byr:1940
hgt:60cm eyr:2027 cid:242 hcl:#b6652a
ecl:grn
hcl:#18171d byr:1957 pid:325895714 iyr:2018
eyr:2023 hgt:162cm
ecl:#a3ed7b
byr:2024
hcl:z eyr:2022 iyr:2016 cid:350 hgt:119 pid:185cm
iyr:2010
byr:2004 eyr:2032 cid:326 hcl:6019c5
ecl:gmt hgt:137
pid:477848102 eyr:2025 hgt:178cm hcl:#e31a3d ecl:brn
byr:1943
pid:#65fca1 eyr:2026 hgt:192cm cid:293 ecl:blu byr:2026 iyr:2024 hcl:#a97842
eyr:2025 cid:181 hgt:186cm byr:1968
ecl:brn pid:318405093 hcl:#341e13 iyr:2015
hcl:#c12f4b eyr:2025 cid:311 pid:652667870
ecl:oth
hgt:166cm
byr:1981 iyr:2016
ecl:hzl
byr:2025 iyr:2014
hcl:138d5c eyr:2037 hgt:160in cid:206
pid:#d9119b
pid:51419740 cid:141
iyr:2012
hgt:90 ecl:#9438f4 hcl:#7d3b0c byr:2021 eyr:2020
pid:#0bc613
hcl:z byr:2017
hgt:91 cid:284 eyr:1966 iyr:2008
ecl:#974ceb
cid:344 iyr:1953 eyr:2020 ecl:hzl byr:2019 hcl:z pid:2969979
ecl:gry
byr:1925 cid:113
hcl:#a97842 pid:744660539 hgt:153cm iyr:2020
hgt:177 pid:856186682 eyr:1968 ecl:blu
cid:167 byr:1986 hcl:#866857 iyr:2015
byr:1937 eyr:2021 iyr:2017
cid:91 hgt:183cm hcl:#a97842 ecl:blu pid:149192621
hgt:154cm hcl:#602927 ecl:oth
byr:1939 iyr:2018 pid:670669747 eyr:2029 cid:301
eyr:2025 pid:249412970 ecl:oth
iyr:2016
byr:1921 hcl:#a97842 hgt:176cm
byr:1969
iyr:2019 hcl:9de0cb
pid:644476999 hgt:75in
ecl:oth eyr:2022
hgt:164cm iyr:2016
byr:1988 ecl:gry
eyr:2030
hcl:#efcc98 pid:393258887
hgt:183cm pid:6930456 eyr:2023 cid:210 ecl:#766482 byr:2023 iyr:2017 hcl:z
iyr:2011 hgt:165cm eyr:2020 byr:1966
hcl:#efcc98 pid:691169980 ecl:blu
iyr:2011 hcl:#602927 eyr:2029
byr:1966
ecl:oth hgt:165cm pid:945383793
pid:567096741 iyr:2025
ecl:gry eyr:1944 hgt:187in byr:2026 hcl:8ac39a
byr:2025
eyr:2025 iyr:2015
hgt:191 pid:1659927272 ecl:grn
iyr:2027 hgt:63in byr:1963 pid:874200881
ecl:oth hcl:#c0946f eyr:2029
hcl:#b37a48
byr:1957 ecl:hzl
eyr:2030
iyr:2013
pid:#38e0fd eyr:2019 cid:103
hgt:153in
ecl:#956d7c
iyr:2029 byr:2029 hcl:z
eyr:2021 pid:956654136
hcl:#854d9d hgt:186cm byr:1960 iyr:2015
eyr:2020
byr:1995
hcl:#b6652a ecl:amb pid:746523744 iyr:2015
hgt:178cm
eyr:2020 hgt:173cm cid:322 byr:1956 iyr:2020 ecl:blu
pid:833595649
ecl:gry iyr:2017 eyr:2020 pid:537816651 hgt:183cm cid:160 byr:1996 hcl:#733820
iyr:1920
byr:2013
hcl:z eyr:1932 pid:169cm
eyr:2030 cid:258 iyr:2020 ecl:grn byr:1947 pid:571610070
hgt:162cm hcl:#888785
byr:2025 hgt:155cm iyr:2030 ecl:amb eyr:2002
iyr:2020 ecl:hzl
pid:090561426 hcl:#a97842
byr:1923
ecl:hzl
iyr:2019
hcl:#c0946f eyr:2025
byr:1999 hgt:178cm pid:026042669
hgt:74in
eyr:2027 iyr:2015 ecl:gry
byr:2005 pid:#28b09d
eyr:1953 byr:2014 ecl:lzr cid:202 hcl:1af88d
iyr:2028
cid:99
pid:706477697 iyr:2018 hgt:171cm eyr:2027
ecl:oth
byr:1978 hcl:#930aef
iyr:2017
byr:1935
eyr:2029
ecl:amb pid:321873254 hgt:179cm hcl:#1b9aea cid:160
iyr:2013 ecl:hzl eyr:2023 cid:233 byr:1996 pid:605962483 hgt:175cm hcl:#ceb3a1
pid:754905579
ecl:brn eyr:2021 hcl:#ceb3a1
byr:1943 hgt:59in
cid:110 byr:1935 eyr:2021 hgt:172cm iyr:2020
pid:643443673 hcl:#888785 ecl:brn
ecl:gmt hcl:#cfa07d
hgt:148 iyr:2024 pid:635827422
eyr:1935
byr:1964
iyr:2012 byr:2016 hcl:z
hgt:178cm pid:213073693 eyr:2005
ecl:#b3cc58 byr:2027 pid:172cm hcl:#888785 hgt:177cm eyr:1988
iyr:2027
eyr:2029
byr:1923
hcl:#d9855b cid:134 pid:068598146 hgt:152cm ecl:blu
cid:309
iyr:2010 ecl:oth hgt:188cm hcl:#18171d eyr:2028 pid:174227992 byr:1931
iyr:2010 hgt:72in cid:266 ecl:brn pid:0090854908
hcl:#623a2f eyr:2032
byr:1967
pid:192554211 eyr:2020 hgt:192cm ecl:gry cid:158 iyr:2015 byr:1940
hcl:#efcc98
cid:248 hgt:75in eyr:2025 byr:1957 hcl:#c0946f
iyr:2019
ecl:brn
pid:96533216 hcl:z ecl:blu eyr:2027 hgt:193cm cid:224
byr:1928 iyr:2014
iyr:2010
eyr:2022 cid:276 hcl:#a97842 byr:1968 ecl:gry pid:808830560 hgt:188cm
hgt:158in
pid:097590485 iyr:2030 eyr:1940 hcl:z cid:274
ecl:#2ea9ec
byr:2024
pid:616947922 byr:1982 iyr:2014 hgt:186cm ecl:oth hcl:#888785
byr:1941 pid:039744699 hcl:#efcc98 hgt:190cm iyr:2011
eyr:2020 ecl:blu
byr:1971
ecl:hzl hgt:65in
pid:076133019 iyr:2019 eyr:2030
ecl:blu iyr:2011 byr:1928 hcl:#c0946f hgt:172cm eyr:2026 pid:171544458
byr:1929 pid:145819079 ecl:hzl
hgt:192cm iyr:2015 eyr:2020 hcl:#b6652a
byr:1981 ecl:amb pid:123467924
eyr:2024 hcl:#18171d
hgt:184cm iyr:2017
byr:1957
ecl:oth pid:881258191 hgt:65in iyr:2010
hcl:#a97842
ecl:amb eyr:2020 hgt:152cm
iyr:2021 pid:9448811025 hcl:#c0946f cid:204 byr:2030
eyr:2022 pid:208725350
byr:1944 ecl:blu hcl:#18171d cid:164
hgt:170cm iyr:2014
hcl:#18171d eyr:1952 iyr:1939 pid:788651896 hgt:157in byr:2007
byr:1944 cid:87 pid:463367304
iyr:2020 hgt:188cm ecl:gry
eyr:2027 hcl:#cfa07d
ecl:hzl
iyr:2018 hgt:164cm byr:1972 cid:272 pid:990204374
hcl:#6b5442
hgt:155cm pid:791416860 iyr:2015
cid:278 hcl:#18171d byr:1994 ecl:brn
eyr:2023
iyr:2017 cid:245 eyr:2026 byr:1932 ecl:blu
hgt:159cm pid:904760812 hcl:#18171d
ecl:blu hcl:#6b5442
iyr:2015 eyr:2023 pid:535891497 hgt:175cm cid:168 byr:1920
byr:2000 hcl:#6b5442 hgt:156cm
pid:765444727 iyr:2012
ecl:brn
eyr:2028
eyr:2005 pid:9092484649
byr:2028
ecl:#5fc7fc hgt:81
iyr:1988 hcl:8280e1
cid:275
byr:1928 iyr:2010 hcl:#888785 pid:596954301 ecl:brn eyr:2020 hgt:166cm
cid:163
byr:1984 eyr:2027 iyr:2020
ecl:gry hgt:166cm pid:650001846
hcl:#602927
iyr:1925 eyr:2030
byr:1985 hcl:#cfa07d ecl:#f16a95 hgt:150cm pid:67853501
ecl:gry
eyr:1949 cid:218 hgt:73cm byr:2004 pid:055108092
iyr:1961
eyr:2024 iyr:2016 pid:133523002
hgt:62in hcl:#d99c14
byr:1996 ecl:hzl
eyr:2026 iyr:2019 hgt:189cm ecl:brn hcl:#623a2f
byr:1979 pid:172111665
iyr:2017
eyr:1937 ecl:#bfd0ee
byr:1964 hcl:#733820
hgt:169cm pid:33181449
eyr:2024 hcl:#6b5442
iyr:2014
hgt:68in pid:577055593 ecl:grn byr:1996
hcl:z cid:150 eyr:2039 byr:2015 pid:2453663020 ecl:brn
hgt:154cm
hcl:#efcc98 eyr:2022
ecl:grn hgt:167cm byr:1978 iyr:2010 pid:180446111
ecl:gry
iyr:2020 hgt:152cm pid:#cce9cf eyr:2028
byr:1942
hcl:z
hcl:#341e13 ecl:brn iyr:2019
pid:589837530 cid:157 byr:1925 hgt:183cm eyr:2020
byr:2009
pid:179cm hgt:164cm
iyr:1927 hcl:#cfa07d eyr:2034
ecl:oth iyr:2012
eyr:2028 hcl:#866857 pid:716964854
byr:1940 cid:113 hgt:193cm
byr:1985 iyr:2011 hcl:#866857 pid:454558712 eyr:2025 cid:301
hgt:62in ecl:blu
hcl:#733820 eyr:2025 ecl:amb
pid:855788635 iyr:2016
byr:1965
cid:140 hgt:183cm
hcl:#efcc98 cid:326 eyr:1961
pid:001357810 iyr:1947 ecl:#8abfc8 hgt:75 byr:2012
hgt:60cm pid:#e28da4 byr:2014 iyr:2019 eyr:2040 ecl:utc
hcl:#733820 eyr:2022 pid:708208638 hgt:162cm cid:326 iyr:2018 ecl:oth byr:1997
iyr:1967 byr:2013 pid:8595504787 hgt:73cm ecl:dne
pid:808787977 hcl:#18171d
cid:205 hgt:181cm
byr:1986
ecl:gry iyr:2013
ecl:dne iyr:2009
byr:2027
hgt:188in hcl:#c0946f
pid:585147305 eyr:2024
hcl:#733820 iyr:2019
eyr:2020
hgt:190cm
pid:042907748 ecl:grn byr:1920
ecl:#603ad1
eyr:2026
hcl:33f9f8
pid:862887360 hgt:156in byr:1993
iyr:2013
ecl:oth eyr:2030 byr:1960
hcl:#a97842 cid:285
hgt:60in pid:655974048 iyr:2016
iyr:2030
hgt:143
pid:65806846 byr:1948 hcl:#72a0d3 eyr:1934 ecl:#7cd402
hcl:z pid:#0f7c0a iyr:2012 hgt:161cm
byr:2022 eyr:1937
hcl:#fffffd ecl:hzl
hgt:191cm byr:1935 iyr:2015 cid:240 eyr:2030 pid:778049989
ecl:amb iyr:2011 hcl:#e196f6 pid:231470794 eyr:2026 hgt:179in byr:1979
ecl:oth hcl:#6b5442 pid:181cm hgt:72cm
eyr:2040 iyr:2010
iyr:2016 eyr:2026 pid:113617276
cid:117 hgt:176cm ecl:grn
hcl:#c5b999
iyr:2016 byr:1941
pid:846760253 hgt:60cm
hcl:#7d3b0c ecl:zzz
eyr:1972
eyr:2023 hcl:#623a2f
cid:103 pid:476193829 hgt:181cm ecl:oth byr:1997
iyr:2014
ecl:#b64a07 hcl:7bb40c byr:2028 eyr:2039 pid:#e2ba33 hgt:189 iyr:1940
pid:#3ecfd8 hcl:#7d3b0c iyr:2014 ecl:#30a5e7 hgt:73cm byr:1954
ecl:dne
byr:2011 pid:512088455
hcl:#18171d eyr:2023
iyr:2024
byr:1996 eyr:2026 pid:268556486 ecl:brn
hgt:150cm
iyr:2013 hcl:#7d3b0c
iyr:2014
ecl:grn pid:222910621 hcl:#602927
eyr:2030 hgt:155cm
pid:530689228 byr:1938
iyr:2015
hgt:185cm ecl:hzl eyr:2022 hcl:#866857
hcl:#b6652a byr:2028 iyr:2018 cid:150 ecl:lzr pid:706073193 hgt:169cm
hgt:171cm ecl:gry hcl:#6b5442 byr:1953
iyr:2011 pid:622763802 eyr:2026
eyr:2032 hgt:137
pid:5033763648
byr:1925 ecl:hzl hcl:#623a2f iyr:2024
byr:1930 pid:6999766453 ecl:#3e3e07
hcl:#602927 iyr:2010 eyr:2039
hgt:160cm
hgt:122 ecl:amb pid:105302121 iyr:2017
hcl:#733820
eyr:2027 byr:1955
hcl:#95f96b
hgt:193cm iyr:2020 pid:719337690
byr:1971
ecl:brn eyr:2024

25
2020/day04/Makefile Normal file
View File

@@ -0,0 +1,25 @@
INPUT := INPUT.txt
SHELL := /bin/bash
CFLAGS := -w
TIME := \time -f "\ttime: %E real, %U user, %S sys\n\tcontext-switch:\t%c+%w, page-faults: %F+%R\n"
export PATH := .:$(PATH)
.PHONY: clean all compile deploy ex1 ex2
all: ex1 ex2
compile: ex1-c ex2-c
ex1: ex1-c
@$(TIME) ex1.bash < $(INPUT) 2>&1
@$(TIME) ex1-c < $(INPUT) 2>&1
ex2: ex2-c
@$(TIME) ex2.bash < $(INPUT) 2>&1
@$(TIME) ex2-c < $(INPUT) 2>&1
clean:
@rm -f ex1-c ex2-c core
deploy:
@$(MAKE) -C .. deploy

12
2020/day04/OUTPUT Normal file
View File

@@ -0,0 +1,12 @@
ex1.bash : valid=182/251
time: 0:00.06 real, 0.06 user, 0.00 sys
ex1-c : valid=182/251
time: 0:00.00 real, 0.00 user, 0.00 sys
ex2.bash : valid=109/251
time: 0:00.16 real, 0.16 user, 0.00 sys
ex2-c : valid=109/251
time: 0:00.00 real, 0.00 user, 0.00 sys

127
2020/day04/README Normal file
View File

@@ -0,0 +1,127 @@
--- Day 4: Passport Processing ---
You arrive at the airport only to realize that you grabbed your North Pole Credentials instead of your passport. While these documents are extremely similar, North Pole Credentials aren't issued by a country and therefore aren't actually valid documentation for travel in most of the world.
It seems like you're not the only one having problems, though; a very long line has formed for the automatic passport scanners, and the delay could upset your travel itinerary.
Due to some questionable network security, you realize you might be able to solve both of these problems at the same time.
The automatic passport scanners are slow because they're having trouble detecting which passports have all required fields. The expected fields are as follows:
byr (Birth Year)
iyr (Issue Year)
eyr (Expiration Year)
hgt (Height)
hcl (Hair Color)
ecl (Eye Color)
pid (Passport ID)
cid (Country ID)
Passport data is validated in batch files (your puzzle input). Each passport is represented as a sequence of key:value pairs separated by spaces or newlines. Passports are separated by blank lines.
Here is an example batch file containing four passports:
ecl:gry pid:860033327 eyr:2020 hcl:#fffffd
byr:1937 iyr:2017 cid:147 hgt:183cm
iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884
hcl:#cfa07d byr:1929
hcl:#ae17e1 iyr:2013
eyr:2024
ecl:brn pid:760753108 byr:1931
hgt:179cm
hcl:#cfa07d eyr:2025 pid:166559648
iyr:2011 ecl:brn hgt:59in
The first passport is valid - all eight fields are present. The second passport is invalid - it is missing hgt (the Height field).
The third passport is interesting; the only missing field is cid, so it looks like data from North Pole Credentials, not a passport at all! Surely, nobody would mind if you made the system temporarily ignore missing cid fields. Treat this "passport" as valid.
The fourth passport is missing two fields, cid and byr. Missing cid is fine, but missing any other field is not, so this passport is invalid.
According to the above rules, your improved system would report 2 valid passports.
Count the number of valid passports - those that have all required fields. Treat cid as optional. In your batch file, how many passports are valid?
Your puzzle answer was 182.
--- Part Two ---
The line is moving more quickly now, but you overhear airport security talking about how passports with invalid data are getting through. Better add some data validation, quick!
You can continue to ignore the cid field, but each other field has strict rules about what values are valid for automatic validation:
byr (Birth Year) - four digits; at least 1920 and at most 2002.
iyr (Issue Year) - four digits; at least 2010 and at most 2020.
eyr (Expiration Year) - four digits; at least 2020 and at most 2030.
hgt (Height) - a number followed by either cm or in:
If cm, the number must be at least 150 and at most 193.
If in, the number must be at least 59 and at most 76.
hcl (Hair Color) - a # followed by exactly six characters 0-9 or a-f.
ecl (Eye Color) - exactly one of: amb blu brn gry grn hzl oth.
pid (Passport ID) - a nine-digit number, including leading zeroes.
cid (Country ID) - ignored, missing or not.
Your job is to count the passports where all required fields are both present and valid according to the above rules. Here are some example values:
byr valid: 2002
byr invalid: 2003
hgt valid: 60in
hgt valid: 190cm
hgt invalid: 190in
hgt invalid: 190
hcl valid: #123abc
hcl invalid: #123abz
hcl invalid: 123abc
ecl valid: brn
ecl invalid: wat
pid valid: 000000001
pid invalid: 0123456789
Here are some invalid passports:
eyr:1972 cid:100
hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926
iyr:2019
hcl:#602927 eyr:1967 hgt:170cm
ecl:grn pid:012533040 byr:1946
hcl:dab227 iyr:2012
ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:1992 cid:277
hgt:59cm ecl:zzz
eyr:2038 hcl:74454a iyr:2023
pid:3556412378 byr:2007
Here are some valid passports:
pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980
hcl:#623a2f
eyr:2029 ecl:blu cid:129 byr:1989
iyr:2014 pid:896056539 hcl:#a97842 hgt:165cm
hcl:#888785
hgt:164cm byr:2001 iyr:2015 cid:88
pid:545766238 ecl:hzl
eyr:2022
iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719
Count the number of valid passports - those that have all required fields and valid values. Continue to treat cid as optional. In your batch file, how many passports are valid?
Your puzzle answer was 109.
Both parts of this puzzle are complete! They provide two gold stars: **
At this point, you should return to your Advent calendar and try another puzzle.
If you still want to see it, you can get your puzzle input.
You can also [Share] this puzzle.

13
2020/day04/TEST.txt Normal file
View File

@@ -0,0 +1,13 @@
ecl:gry pid:860033327 eyr:2020 hcl:#fffffd
byr:1937 iyr:2017 cid:147 hgt:183cm
iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884
hcl:#cfa07d byr:1929
hcl:#ae17e1 iyr:2013
eyr:2024
ecl:brn pid:760753108 byr:1931
hgt:179cm
hcl:#cfa07d eyr:2025 pid:166559648
iyr:2011 ecl:brn hgt:59in

132
2020/day04/ex1-c.c Normal file
View File

@@ -0,0 +1,132 @@
/* ex1-c: Advent2020 game, day 4/game 1
*/
#include <stdio.h>
#include <stdlib.h>
struct key {
int mandatory;
char *key;
char val[80];
} keys[] = {
{ 1, "byr", "" },
{ 1, "iyr", "" },
{ 1, "eyr", "" },
{ 1, "hgt", "" },
{ 1, "hcl", "" },
{ 1, "ecl", "" },
{ 1, "pid", "" },
{ 0, "cid", "" },
{ -1, NULL, "" }
};
int my_strlen(str)
char *str;
{
int i;
for (i=0; *str; ++i, ++str)
;
return i;
}
int my_strcmp(str1, str2)
char *str1, *str2;
{
for(; *str1 && (*str1==*str2); str1++, str2++)
;
return *str1 - *str2;
}
char *my_strcpy(dst, src)
char *dst, *src;
{
char *p=dst;
while (*dst++ = *src++)
;
return p;
}
struct key *get_key(key)
char *key;
{
int i=0, found=0;
for (i=0; keys[i].mandatory != -1; ++i) {
if (!my_strcmp(keys[i].key, key)) {
found=1;
break;
}
}
return found? &keys[i]: NULL;
}
struct key *set_key(key, val)
char *key, *val;
{
struct key *thekey;
if (thekey=get_key(key))
my_strcpy(thekey->val, val);
return thekey;
}
void print_keys()
{
int i=0;
printf("keys: \n");
for (i=0; keys[i].mandatory != -1; ++i)
printf("\t[%s]=[%s]\n", keys[i].key, keys[i].val);
return;
}
void reset_keys()
{
int i=0;
for (i=0; keys[i].mandatory != -1; ++i)
*keys[i].val='\0';
return;
}
int valid_passport()
{
int valid=1;
struct key *key=&keys[0];
while (key->mandatory != -1) {
if (key->mandatory && !*key->val) {
valid=0;
break;
}
key++;
}
return valid;
}
int main(ac, av)
char **av;
{
int consumed, nkeys, nvalid=0, count=0;
char line[160], key[80], val[80];
char *p;
while (fgets(line, sizeof line, stdin)) {
nkeys=0;
p=line;
consumed=1;
while (sscanf(p, "%[^:]: %s %n", key, val, &consumed)==2) {
set_key(key, val);
p+=consumed;
nkeys++;
}
if (!nkeys) { /* empty line: reset */
nvalid += valid_passport();
count++;
reset_keys();
}
}
nvalid += valid_passport();
count++;
printf("%s : valid=%d/%d\n", *av, nvalid, count);
exit (0);
}

51
2020/day04/ex1.bash Executable file
View File

@@ -0,0 +1,51 @@
#!/bin/bash
#
# ex1.bash: Advent2020 game, day 4/game 1.
CMD=${0##*/}
shopt -s extglob
declare -A KEYS
KEYS=( ["byr"]="" ["iyr"]="" ["eyr"]="" ["hgt"]="" ["hcl"]="" ["ecl"]=""
["pid"]="" ["cid"]="" )
function reset_array() { # reset array values
local -n array=${1}
local key
#echo before reset: ${KEYS[@]}
for key in "${!array[@]}"; do
array[$key]=""
done
#echo after reset: ${KEYS[@]}
}
function passport_valid() {
local -i ret=0
for key in "${!KEYS[@]}"; do
[[ $key != "cid" ]] && [[ -z ${KEYS[$key]} ]] && ret=1 && break
done
return $ret
}
declare -i current=0 nvalids=0
while read -r line; do
if [[ -z "$line" ]]; then
((current++))
passport_valid && ((nvalids ++))
reset_array KEYS
continue
fi
for pair in $line; do
key=${pair%%:*}
val=${pair##*:}
[[ -v KEYS[$key] ]] && KEYS[$key]="$val" # valid key
done
done
((current++))
passport_valid && ((nvalids ++))
printf "%s : valid=%d/%d\n" "$CMD" "$nvalids" "$current"
exit 0

233
2020/day04/ex2-c.c Normal file
View File

@@ -0,0 +1,233 @@
/* ex2-c: Advent2020 game, day 4/game 2
*/
#include <stdio.h>
#include <stdlib.h>
#define BYR 0
#define IYR 1
#define EYR 2
#define HGT 3
#define HCL 4
#define ECL 5
#define PID 6
#define CID 7
struct key {
int mandatory;
char *key;
char val[80];
} keys[] = {
{ 1, "byr", "" },
{ 1, "iyr", "" },
{ 1, "eyr", "" },
{ 1, "hgt", "" },
{ 1, "hcl", "" },
{ 1, "ecl", "" },
{ 1, "pid", "" },
{ 0, "cid", "" },
{ -1, NULL, "" }
};
char *eyes[] = {
"amb", "blu", "brn", "gry", "grn", "hzl", "oth", NULL
};
int my_strlen(str)
char *str;
{
int i;
for (i=0; *str; ++i, ++str)
;
return i;
}
int my_strcmp(str1, str2)
char *str1, *str2;
{
for(; *str1 && (*str1==*str2); str1++, str2++)
;
return *str1 - *str2;
}
char *my_strcpy(dst, src)
char *dst, *src;
{
char *p=dst;
while (*dst++ = *src++)
;
return p;
}
int my_digitstr(str)
char *str;
{
for (; *str >= '0' && *str <= '9'; ++str)
;
return *str? 0: 1;
}
struct key *get_key(key)
char *key;
{
int i=0, found=0;
for (i=0; keys[i].mandatory != -1; ++i) {
if (!my_strcmp(keys[i].key, key)) {
found=1;
break;
}
}
return found? &keys[i]: NULL;
}
int get_key_num(key)
char *key;
{
struct key *k=get_key(key);
return k? k-&keys[0]: -1;
}
struct key *set_key(key, val)
char *key, *val;
{
struct key *thekey;
if (thekey=get_key(key))
my_strcpy(thekey->val, val);
return thekey;
}
void print_keys()
{
int i=0;
printf("keys: \n");
for (i=0; keys[i].mandatory != -1; ++i)
printf("\t[%s]=[%s]\n", keys[i].key, keys[i].val);
return;
}
void reset_keys()
{
int i=0;
for (i=0; keys[i].mandatory != -1; ++i)
*keys[i].val='\0';
return;
}
int check_eyes(val)
char *val;
{
int ret=0;
char **col=eyes;
while (*col) {
if (!my_strcmp(val, *col)) {
ret=1;
break;
}
col++;
}
return ret;
}
int valid_key(keypos)
int keypos;
{
int good=0, i, len;
char *val=keys[keypos].val, buf[80];
len=my_strlen(val);
switch (keypos) {
case BYR:
if (len == 4 && my_digitstr(val)) {
i=atoi(val);
if (i >= 1920 && i <= 2002)
good=1;
}
break;
case IYR:
if (len == 4 && my_digitstr(val)) {
i=atoi(val);
if (i >= 2010 && i <= 2020)
good=1;
}
break;
case EYR:
if (len == 4 && my_digitstr(val)) {
i=atoi(val);
if (i >= 2020 && i <= 2030)
good=1;
}
break;
case HGT:
if (sscanf(val, "%d%s", &i, buf) == 2) {
if ((!my_strcmp(buf, "cm") && i >= 150 && i <= 193 ) ||
(!my_strcmp(buf, "in") && i >= 59 && i <= 76 ))
good=1;
}
break;
case HCL:
if (len == 7 && *val == '#') {
i = sscanf(val+1, "%[a-f0-9]", buf);
good = 1;
}
break;
case ECL:
good=check_eyes(val);
break;
case PID:
if (my_strlen(val) == 9 &&
my_digitstr(val)) {
good=1;
}
break;
case CID:
good=1;
break;
default:
break;
}
return good;
}
int valid_passport()
{
int valid=1;
struct key *key=&keys[0];
while (key->mandatory != -1) {
if (!valid_key(key-&keys[0])) {
valid=0;
break;
}
key++;
}
return valid;
}
int main(ac, av)
char **av;
{
int consumed, nkeys, nvalid=0, count=0;
char line[160], key[80], val[80];
char *p;
while (fgets(line, sizeof line, stdin)) {
nkeys=0;
p=line;
consumed=1;
while (sscanf(p, "%[^:]: %s %n", key, val, &consumed)==2) {
set_key(key, val);
p+=consumed;
nkeys++;
}
if (!nkeys) { /* empty line: reset */
nvalid+=valid_passport();
count++;
reset_keys();
}
}
nvalid += valid_passport();
count++;
printf("%s : valid=%d/%d\n", *av, nvalid, count);
exit (0);
}

125
2020/day04/ex2.bash Executable file
View File

@@ -0,0 +1,125 @@
#!/bin/bash
#
# ex2.bash: Advent2020 game, day 4/game 2.
CMD=${0##*/}
shopt -s extglob
declare -A KEYS=( ["byr"]="" ["iyr"]="" ["eyr"]="" ["hgt"]="" ["hcl"]="" ["ecl"]=""
["pid"]="" ["cid"]="" )
NKEYS=${#KEYS[@]}
function reset_array() { # reset array values
local -n array=${1}
local key
#echo before reset: ${KEYS[@]}
for key in "${!array[@]}"; do
array[$key]=""
done
#echo after reset: ${KEYS[@]}
}
# returns 1 if $1 length is $2
function check_length() {
return $((${#1} != $2))
}
function check_digits() {
[[ "$1" =~ ^[[:digit:]]+$ ]] && return 0 || return 1
}
# returns 1 if $1 is between $2 and $3
function check_range() {
(($1 >= $2 && $1 <= $3)) && return 0 || return 1
}
declare -A COLORS=( ["amb"]="" ["blu"]="" ["brn"]="" ["gry"]=""
["grn"]="" ["hzl"]="" ["oth"]="" )
function check_eye() {
[[ -v COLORS["$1"] ]] && return 0 || return 1
}
function check_height() {
local -i ret=1
local val="$1" unit=${val: -2}
local num=${val%%$unit}
#printf "unit=%s hgt=%s\n" "$unit" "$num"
case "$unit" in
"cm") check_digits "$num" && check_range "$num" 150 193 && ret=0
;;
"in") check_digits "$num" && check_range "$num" 59 76 && ret=0
;;
esac
return $ret
}
function check_hair() {
[[ "$1" =~ ^#[a-f0-9]{6}$ ]] && return 0 || return 1
}
function check_key() {
local -i valid=0
local key="$1" val="${KEYS[$key]}"
#printf "KEY/VAL = %s=[%s]\n" "$key" "$val"
case "$key" in
cid) valid=1
;;
byr) check_digits "$val" &&
check_length "$val" 4 &&
check_range "$val" 1920 2002 && valid=1
;;
iyr) check_digits "$val" &&
check_length "$val" 4 &&
check_range "$val" 2010 2020 && valid=1
;;
eyr) check_digits "$val" &&
check_length "$val" 4 &&
check_range "$val" 2020 2030 && valid=1
;;
pid) check_digits "$val" &&
check_length "$val" 9 && valid=1
;;
ecl) check_eye "$val" && valid=1
;;
hcl) check_hair "$val" && valid=1
;;
hgt) check_height "$val" && valid=1
;;
# TODO
*) valid=1
;;
esac
#printf "%s=[%s] : valid=%d\n" "$key" "$val" $valid
#[[ ! $key == "cid" ]] && [[ -z ${KEYS[$key]} ]] && valid=0 && break
return $valid
}
function passport_valid() {
local -i ret=0
for key in "${!KEYS[@]}"; do
#printf "current key: %s\n" "$key"
[[ $key != "cid" ]] && #[[ -z ${KEYS[$key]} ]] &&
check_key "$key" && ret=1 && break
done
return $ret
}
declare -i current=0 nvalids=0
while read -r line; do
if [[ -z "$line" ]]; then
((current++))
passport_valid && ((nvalids ++))
reset_array KEYS
continue
fi
for pair in $line; do
key=${pair%%:*}
val=${pair##*:}
[[ -v KEYS[$key] ]] && KEYS[$key]="$val" # valid key
done
done
((current++))
passport_valid && ((nvalids ++))
printf "%s : valid=%d/%d\n" "$CMD" "$nvalids" "$current"
exit 0