Submission details
Task:ModAdd
Sender:smolse
Submission time:2016-09-24 13:37:47 +0300
Language:Python3
Status:READY
Result:
Test results
testverdicttime
#10.07 sdetails
#20.06 sdetails
#30.06 sdetails
#40.07 sdetails
#50.05 sdetails
#60.06 sdetails
#70.07 sdetails
#80.06 sdetails
#90.06 sdetails
#100.06 sdetails

Code

import fileinput

with fileinput.input(['z']) as input:
    a = list(input.readline().rstrip())
    b = list(input.readline().rstrip())
    res = []
    a.reverse()
    b.reverse()
    for i in range(max(len(a), len(b))):
        try:
            a_i = int(a[i])
        except IndexError:
            res += b[i:]
            break
        try:
            b_i = int(b[i])
        except IndexError:
            res += a[i:]
            break
        res.append(str((a_i + b_i) % 10))
    res.reverse()
    print(int(''.join(res)))

Test details

Test 1

Verdict:

input
3797629225
9766508989

correct output
2453127104

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 2

Verdict:

input
552139016901047883384892240490...

correct output
552139016901047883384892240490...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 3

Verdict:

input
860793811134668093345482099582...

correct output
487710306894083216377653715430...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 4

Verdict:

input
2
870841652294197226626825161089...

correct output
870841652294197226626825161089...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 5

Verdict:

input
0
404905566051213252279994991040...

correct output
404905566051213252279994991040...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 6

Verdict:

input
430112167406460960088878635088...

correct output
430112167406460960088878635088...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 7

Verdict:

input
867016005819001635643395991596...

correct output
999999999999999999999999999999...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 8

Verdict:

input
120453771521975552204976752778...

correct output
0

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 9

Verdict:

input
239979749009277805816504910098...

correct output
239979749009277805816504910098...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...

Test 10

Verdict:

input
990963963634143754324162574923...

correct output
818540385713473048971388312665...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 4, in <module>
    a = lis...