6, boring
This commit is contained in:
parent
4b0013ee1c
commit
a612669e19
10
README.md
10
README.md
|
@ -8,4 +8,12 @@ day is visible until you solve it.
|
|||
Most solutions output at most two lines, the answers to part 1 and 2; but some
|
||||
provide more information in the form of e.g. graphics.
|
||||
|
||||
Run a solution by passing the puzzle input to the program.
|
||||
Run a solution by passing the puzzle input to the program:
|
||||
|
||||
```
|
||||
./two.bash < input2
|
||||
```
|
||||
or
|
||||
```
|
||||
./five.py -v < test5
|
||||
```
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from useful import *
|
||||
|
||||
ns = numbers(open(0).read())
|
||||
print(max(ns))
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from useful import *
|
||||
|
||||
ts, ds = [numbers(l) for l in lines(open(0))]
|
||||
|
||||
def wins(t, d):
|
||||
return sum(i*(t-i) > d for i in range(t))
|
||||
|
||||
print(np.prod([wins(t, d) for (t, d) in zip(ts, ds)]))
|
||||
print(wins(*[int(''.join(str(el) for el in ar)) for ar in (ts, ds)]))
|
Loading…
Reference in New Issue