about summary refs log tree commit diff
path: root/daily/285easy/2dec.py
blob: a0b6bb2824a1f2fccb8f606321c36e8af4473a27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

tmp = 0

with open('2dec.inp') as fi, open('2dec.out', 'w') as fo:
    for line in fi:
        l = []
        for n in line.split():
            tmp += int(n)
            if n != '255':
                l.append(str(tmp))
                tmp = 0
        fo.write(' '.join(l) + '\n')