This commit is contained in:
Yanick Champoux 2018-12-01 09:32:12 -05:00
parent d77d0d30fc
commit 292bca1eca
3 changed files with 1019 additions and 0 deletions

998
2018/01/input.txt Normal file
View File

@ -0,0 +1,998 @@
-14
-9
-14
-12
+13
+2
+7
-18
+10
-8
+13
+12
+11
-1
+9
+3
+6
-1
+11
-9
-6
+11
-3
+18
-7
+13
-11
+18
+10
+9
+16
+11
+14
-19
+14
-3
-8
-5
-10
-18
-9
-10
+6
+8
+10
+10
-19
+18
+17
-14
+4
+2
+4
-17
+3
-9
-16
-16
+7
+7
+21
+13
-11
+17
+11
+1
+19
-4
+6
-7
-13
-10
+11
-4
-2
-22
-9
+8
-19
-12
-13
-8
-16
-4
-14
-8
-1
+7
+11
-4
-4
-6
-13
-12
-11
-19
-3
+10
+1
+19
+12
+9
-12
+4
+16
+14
+1
-8
-9
+5
+17
+12
-20
+7
-11
+15
+18
-10
-4
-6
+9
+19
+8
+24
-18
-10
-11
-3
+17
+17
-4
-7
-10
+20
+8
+5
+19
+31
-9
+18
-7
-13
-2
-1
+12
+1
+11
-4
+13
+3
+2
+5
+8
-1
+7
+2
+6
+9
-10
+15
+8
-6
+12
+16
+10
-19
-18
-6
+9
+1
-19
+6
-1
+5
+18
+9
+12
-6
+18
-17
+15
+5
+13
-19
+10
+14
-7
+16
-18
+8
-5
-13
+17
+17
+15
-7
-3
+18
+5
+12
+17
+11
-18
+13
+16
-14
-10
+14
+18
+2
+14
+16
+18
+9
+14
-19
+16
-12
+7
-12
-1
+4
+10
+17
-2
-3
+6
+3
+18
+10
-6
+17
-5
-13
-20
+7
+7
+9
-19
+2
+12
+8
-11
+7
-3
-8
-2
-1
-5
-15
-16
-5
-12
+2
-10
-7
-14
-2
-14
-13
-19
-17
-5
+14
-4
+5
-3
-8
+2
+2
-14
-7
+4
+16
-19
-17
-16
-18
+2
-10
+14
-16
-8
+1
-12
+4
+6
-14
-19
+11
-16
+17
+20
+8
+7
+19
+8
-18
-15
+8
-11
-24
+11
-7
-14
-18
-19
-15
-13
+22
+15
-12
-2
+19
-9
-13
-4
+10
-14
-6
+12
-11
+8
-6
-1
-5
-16
+3
-1
+21
+1
-12
+22
+30
-16
+15
-16
-7
-25
+28
+29
+10
-5
+23
+2
-12
+6
+15
+24
-4
+8
+14
-7
-13
+23
-2
+17
+4
-5
-5
-4
+6
+15
-10
+16
-1
-9
-16
-5
-10
+2
-22
+18
+10
+9
+15
-10
-19
+9
+41
+6
-4
-10
+13
+7
+6
+14
+4
+5
+19
+7
-17
-8
+7
-5
+21
-2
+12
-13
-16
+9
+11
+16
-1
+12
-15
+1
+10
-15
-20
-19
-11
+16
-9
+8
-22
+17
+18
-1
+13
+5
+23
-16
+11
-3
+18
+10
+10
-8
-6
+12
+11
+15
-19
-3
+6
-14
-10
+1
+18
-16
+8
+17
-21
-22
-5
-18
-15
-15
-5
-8
-3
-13
+5
+14
+1
+29
+12
+2
+22
+25
-34
-2
-27
+15
-23
-28
-13
+9
-26
-16
+17
-7
+35
+77
+47
-8
+34
-12
+1
-20
+24
+19
-16
+19
-14
+12
+7
+14
+13
-21
-5
-2
-5
+13
+3
+3
+2
-17
-15
+7
+12
+7
+2
-8
-12
-7
+3
-15
-16
+22
+10
-3
-10
+30
+17
-10
+11
-5
-1
+4
+15
+2
+54
-36
+53
-19
-9
-10
+50
+1
+21
+13
+14
-24
-6
-52
+11
-95
-25
-5
-14
+70
+199
-3
+2
-7
-7
+49
-7
+11
-33
-10
+13
+86
-34
-34
+127
-25
-1700
-76565
-15
+43
-9
-9
+41
+24
+24
-27
+13
-16
-19
-29
-4
-52
-25
-9
-7
+6
-19
+2
+3
+7
+19
-7
-3
+6
-16
-3
-20
+18
+16
+8
+6
-13
+18
+7
+8
-23
-1
-14
-8
-1
-8
-10
-11
-2
-5
-16
+5
+3
-17
-5
-16
-8
+7
-18
-7
-3
+13
+9
+4
+15
+19
+17
-1
-4
+14
+14
+5
-21
+11
-22
+18
+3
-13
-20
-6
-12
+4
-1
+5
+7
-19
+17
-14
+6
+6
+8
+16
+1
+8
+5
+4
+1
+22
-21
-10
-20
+15
+6
+12
+17
+9
+14
+1
-5
+10
-62
-19
-13
-1
-19
-2
-16
+4
+5
-17
-16
-3
-14
-7
+15
+5
-12
-2
+19
-13
+1
-15
-16
+12
-16
-17
+13
+12
-16
+19
+7
+1
-10
+16
-2
-8
-16
+11
-9
-12
+13
-12
+1
-11
-12
-4
+12
-9
-16
-7
+16
+12
+2
-17
-17
+9
-7
-10
-8
+1
-2
+7
+9
+8
+8
-17
-5
-7
-11
-8
-10
-6
+11
-17
-8
-13
+18
-19
+10
-19
-12
-5
-12
-15
+3
-15
+14
+9
+19
-1
-12
-10
+12
-18
-15
+4
-15
+17
-20
+10
+1
+15
+10
+10
-9
+12
-16
+15
+14
+5
-6
+3
+14
-3
+8
+2
-1
+3
-10
-7
+23
-3
-22
+5
+21
+18
-15
-9
+11
+3
+14
+11
+19
-14
-18
+14
-4
+13
+12
+12
+18
+9
-4
-18
+4
+17
-10
+20
-2
+9
-2
+4
-10
+19
-16
+4
-22
-1
+13
+7
+11
+2
+11
-19
+11
+9
+14
-9
+5
+7
+2
+13
+10
+1
+16
-5
-17
-8
+5
+4
+6
+1
+12
+14
-19
+1
+11
-8
-25
-6
-18
+26
+17
+12
-15
+19
+7
-5
+20
-5
+2
+12
-11
-6
-2
+6
-19
-24
-15
+20
+3
+26
+17
+13
-23
+31
+5
+29
-30
+5
+56
-59
-59
-40
-14
+18
-66
-7
-23
-1
-12
-6
-16
+4
+8
+17
+21
-14
-18
-7
-18
-5
+1
+12
+2
+2
+15
+21
-20
-4
-4
-14
-9
-22
+15
-9
+13
-16
+7
-17
-10
-3
-14
+2
-10
-19
-8
-19
+6
-15
-18
+3
-19
+10
-6
+7
+20
-4
-6
-13
-14
-11
+5
+7
-9
+11
-1
+9
+13
-15
-10
-13
-5
-13
-6
+5
+20
-7
-10
+13
-5
+13
-6
+5
-18
-12
-12
-17
+6
-9
-21
+1
+6
-12
+15
-14
+24
+6
+18
-16
+15
-18
-6
+20
+11
+4
-17
+8
-9
+78549

16
2018/01/sol2.pl Normal file
View File

@ -0,0 +1,16 @@
use List::AllUtils qw/ sum first /;
use 5.20.0;
my @nums = <>;
my $index = 0;
my %seen;
my $current = 0;
while() {
$current += $nums[ $index++ % @nums ];
say $current and last if $seen{$current};
$seen{$current}++;
}

5
2018/01/solution.pl Normal file
View File

@ -0,0 +1,5 @@
use List::AllUtils qw/ sum /;
use 5.20.0;
say sum <>;