diff options
Diffstat (limited to '22.13/main.py')
-rw-r--r-- | 22.13/main.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/22.13/main.py b/22.13/main.py index 25b09a1..1abc9d1 100644 --- a/22.13/main.py +++ b/22.13/main.py @@ -1,5 +1,6 @@ import json import sys +from functools import cmp_to_key lines = [json.loads(s) for s in sys.stdin.readlines() if s.strip()] @@ -28,3 +29,8 @@ for i in range(0, len(lines), 2): if cmp(a,b) != 1: partOne += i//2+1 print(partOne) + +divs = [ [[2]], [[6]] ] +lines += divs +lines = sorted(lines, key=cmp_to_key(cmp)) +print((lines.index(divs[0]) + 1) * (lines.index(divs[1]) + 1)) |