Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | CornerMercury | Python | 188 | 85 | 103 | 41 days ago |
2 | dbasden | Python | 222 | 102 | 120 | 41 days ago |
3 | Michael Böiers | Kotlin | 253 | 119 | 134 | 37 days ago |
4 | Mechazawa | JavaScript | 268 | 122 | 146 | 37 days ago |
from
operator
import
*
from
itertools
import
product
import
sys
part_1
=
0
for
l
in
sys
.
stdin
:
l
,
r0
,
*
r
=
map
(
int
,
l
.
replace
(
'
:
'
,
'
'
)
.
split
(
)
)
for
ops
in
product
(
(
add
,
mul
)
,
repeat
=
len
(
r
)
)
:
res
=
r0
for
op
,
rr
in
zip
(
ops
,
r
)
:
res
=
op
(
res
,
rr
)
if
res
==
l
:
part_1
+=
l
break
print
(
part_1
)