This commit is contained in:
setop 2021-12-02 00:22:53 +01:00
commit dd69954b09
4 changed files with 2034 additions and 0 deletions

16
d01/d01_1.awk Normal file
View File

@ -0,0 +1,16 @@
NR == 1 {
A = $1
next
}
$1 > A {
N++
}
{
A = $1
}
END {
print N
}

8
d01/d01_2.py Normal file
View File

@ -0,0 +1,8 @@
import sys
L = [ int(l[:-1]) for l in sys.stdin.readlines() ]
Z = zip(L, L[1:], L[2:])
M = [ a+b+c for (a,b,c) in Z]
Y = zip(M, M[1:])
P = [ [0,1][a<b] for (a,b) in Y ]
#print([(l,m,p) for (l,m,p) in zip(L,M,P)])
print(sum(P))

2000
d01/input Normal file

File diff suppressed because it is too large Load Diff

10
d01/sample Normal file
View File

@ -0,0 +1,10 @@
199
200
208
210
200
207
240
269
260
263