s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s421085918
p00015
u460331583
1346527896
Python
Python
py
Accepted
10
4252
148
count =int(input()) for a in range(count): x,y=int(input()),int(input()) ans = str(x+y) if len(ans) >80:print "overflow" else: print ans
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,202
s230270282
p00015
u894941280
1346527916
Python
Python
py
Accepted
10
4248
148
count =int(input()) for a in range(count): x,y=int(input()),int(input()) ans = str(x+y) if len(ans) >80:print "overflow" else: print ans
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,203
s209751724
p00015
u881567576
1349862116
Python
Python
py
Accepted
20
4284
752
line_num = int(raw_input()) for n in range(line_num): a = raw_input() b = raw_input() if len(a) > 80 or len(b) > 80: print 'overflow' else: filled_a, filled_b = a.zfill(80), b.zfill(80) rlist_a = map(int,list(filled_a)[::-1]) rlist_b = map(int,list(filled_b)[::-1]) rlist_sum = [] for n in range(80): ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,204
s244704752
p00015
u647766105
1351613178
Python
Python
py
Accepted
10
4240
148
n=input() for i in xrange(n): a=input() b=input() sum=str(a+b) if len(sum)>80: print "overflow" else : print sum
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,205
s593119629
p00015
u719737030
1351669892
Python
Python
py
Accepted
10
4248
182
ds = int(raw_input()) for i in xrange(ds): x=int(raw_input()) y=int(raw_input()) sum = str(x+y) if len(sum) > 80: print "overflow" else: print sum
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,206
s090383818
p00015
u290605490
1355230134
Python
Python
py
Accepted
20
4240
134
n=input() for i in range(n): a=input() b=input() if len(str(a+b))>80: print "overflow" else: print a+b
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,207
s898298919
p00015
u280179677
1355411252
Python
Python
py
Accepted
10
5756
346
def datasets(): import sys for i in range(int(sys.stdin.readline().strip())): s1 = sys.stdin.readline().strip() s2 = sys.stdin.readline().strip() yield s1, s2 for s1, s2 in datasets(): r = int(s1)+int(s2) if len(s1)>80 or len(s2)>80 or len(str(r))>80: print "overflow" ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,208
s421054609
p00015
u419407022
1356041157
Python
Python
py
Accepted
20
4252
183
n = long(raw_input()) for i in range(n): a = long(raw_input()) b = long(raw_input()) c = a + b if(len(str(c)) > 80): print 'overflow' else: print c
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,209
s867979626
p00015
u310759044
1357092751
Python
Python
py
Accepted
10
4240
106
for i in range(input()): x=input();y=input(); if len(str(x+y))>80: print "overflow" else: print x+y
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,210
s629933206
p00015
u310759044
1357092825
Python
Python
py
Accepted
10
4240
106
for i in range(input()): x=input();y=input(); if len(str(x+y))>80: print "overflow" else: print x+y
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,211
s127478611
p00015
u310759044
1357092902
Python
Python
py
Accepted
10
4240
127
for i in range(input()): x=input();y=input(); if len(str(x+y))>80: print "overflow" else: print x+y
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,212
s388192681
p00015
u126791750
1357123792
Python
Python
py
Accepted
10
4252
160
n = int(raw_input()) for i in range(n): a = int(raw_input()) b = int(raw_input()) sum = str(a + b) if len(sum) > 80: print("overflow") else: print(sum)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,213
s848146936
p00015
u560838141
1357556977
Python
Python
py
Accepted
10
4252
186
n = int(raw_input()) for i in range(0, n): x = int(raw_input()) y = int(raw_input()) sum = str(x+y) if len(sum) > 80: print 'overflow' else: print sum
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,214
s066849864
p00015
u794549850
1360828659
Python
Python
py
Accepted
10
4248
172
for i in range(int(raw_input())): x = int(raw_input()) y = int(raw_input()) s = str(x+y) if len(s) > 80: print "overflow" else : print s
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,215
s144242771
p00015
u782850731
1362089669
Python
Python
py
Accepted
10
4268
327
from __future__ import (absolute_import, division, print_function, unicode_literals) from sys import stdin n = int(stdin.readline()) while n: result = long(stdin.readline()) + long(stdin.readline()) if len(str(result)) >= 81: print('overflow') else: print(result) ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,216
s590648791
p00015
u743065194
1363912198
Python
Python
py
Accepted
10
4276
575
''' Created on Mar 21, 2013 @author: wukc ''' from sys import stdin n=int(stdin.readline()) for i in range(n): a,b=[stdin.readline().strip().lstrip("0") for k in range(2)] if len(a)>80 or len(b)>80: print("overflow") continue a,b=a.rjust(len(b),'0'),b.rjust(len(a),'0') ans=[] c=0 ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,217
s340199793
p00015
u282635979
1363940316
Python
Python
py
Accepted
10
4248
163
for val in xrange(0,input()): a = input() b = input() c = a+b if len(str(a)) <= 80 and len(str(b)) <= 80 and len(str(c)) <= 80: print c else: print 'overflow'
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,218
s909268311
p00015
u256940798
1365698731
Python
Python
py
Accepted
20
4252
152
n=int(raw_input()) for i in range(0,n): a=int(raw_input()) b=int(raw_input()) c=str(a+b) if len(c)<=80: print c else: print "overflow"
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,219
s031937455
p00015
u865312527
1372780899
Python
Python
py
Accepted
10
4256
210
n=input() for i in range(n): x=input() y=input() if 80<len(str(x)) or 80<len(str(y)): print 'overflow' else: ans=x+y if 80<len(str(ans)): print 'overflow' else: print x+y
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,220
s808103138
p00015
u881100444
1376726838
Python
Python
py
Accepted
10
4252
187
n = int(raw_input()) for i in range(0,n): a = int(raw_input()) b = int(raw_input()) ans = str(a+b) if len(ans) > 80: print 'overflow' else: print ans
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,221
s442665357
p00015
u912237403
1377416958
Python
Python
py
Accepted
20
4260
308
def isoverflow(s): if len(s)>80: return True else: return False n = input() for i in range(n): a = input() b = input() if isoverflow(str(a)) or isoverflow(str(b)): print "overflow" else: tmp = a+b if isoverflow(str(tmp)): print "overflow" else: print tmp
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,222
s872913856
p00015
u813384600
1379496634
Python
Python
py
Accepted
10
4240
159
n = int(raw_input()) for _ in range(n): r = int(raw_input()) + int(raw_input()) if len(str(r)) > 80: print 'overflow' else: print r
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,223
s200019554
p00015
u523886269
1381060573
Python
Python
py
Accepted
20
4256
386
#! /usr/bin/python num_inputs = int(raw_input()) limit = 100000000000000000000000000000000000000000000000000000000000000000000000000000000 count = 0 while count < num_inputs: num1 = int(raw_input()) num2 = int(raw_input()) if num1 >= limit or num2 >= limit: print('overflow') else: num = num1 + num2 if num...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,224
s924500006
p00015
u547057305
1384557429
Python
Python
py
Accepted
10
4224
98
for x in range(input()): a = input() + input() print a if len(str(a)) < 81 else "overflow"
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,225
s724446281
p00015
u023846178
1388494101
Python
Python
py
Accepted
10
4232
181
n = int(raw_input()) for i in range(n): a = long(raw_input()) b = long(raw_input()) s = a + b if s >= pow(10, 80): print "overflow" else: print s
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,226
s783820621
p00015
u621997536
1388944220
Python
Python
py
Accepted
10
4360
132
import math n = input() for i in range(n): a = input() + input() if(len(str(a)) > 80): print "overflow" else: print a
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,227
s253925876
p00015
u230836528
1392289525
Python
Python
py
Accepted
10
4240
172
for i in range(int(raw_input())): x = int(raw_input()) y = int(raw_input()) s = str(x+y) if len(s) > 80: print "overflow" else : print s
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,228
s775538792
p00015
u633068244
1393361476
Python
Python
py
Accepted
10
4236
180
n = int(raw_input()) for i in range(n): a = long(raw_input()) b = long(raw_input()) c = a+b if len(str(c)) > 80: print "overflow" else: print c
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,229
s079201331
p00015
u124909914
1393489884
Python
Python
py
Accepted
20
4256
553
import sys n = input() for i in range(n): a = list(reversed(map(int, raw_input()))) b = list(reversed(map(int, raw_input()))) if len(a) < len(b): a, b = b, a for j in range(len(a)): if j < len(b): a[j] += b[j] if a[j] >= 10: a[j] -= 10 if j !=...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,230
s916767947
p00015
u912237403
1393767029
Python
Python
py
Accepted
20
4248
193
s="overflow" n=input() for i in range(n): a=raw_input() b=raw_input() if len(a)>80 or len(b)>80: print s else: tmp=int(a)+int(b) if len(str(tmp))>80: print s else: print tmp
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,231
s182092113
p00015
u912237403
1393767578
Python
Python
py
Accepted
10
4236
136
m=10**80 n=input() for i in range(n): s="overflow" a=input() b=input() if a<m and b<m: tmp=a+b if tmp<m: s=tmp print s
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,232
s164155168
p00015
u912237403
1393767994
Python
Python
py
Accepted
10
4232
114
n=input() for i in range(n): a=input() b=input() c=a+b if len(str(c))>80: print "overflow" else: print c
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,233
s114086061
p00015
u858885710
1393930022
Python
Python
py
Accepted
10
4224
148
n = int(raw_input()) for i in range(n): a = int(raw_input()) b = int(raw_input()) if a+b >= 10**80: print 'overflow' else: print a+b
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,234
s368980192
p00015
u246033265
1396613986
Python
Python
py
Accepted
10
4224
125
for i in range(int(raw_input())): a = str(int(raw_input()) + int(raw_input())) print 'overflow' if len(a) > 80 else a
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,235
s992990581
p00015
u708217907
1398210178
Python
Python
py
Accepted
10
4232
140
n = int(input()) for i in range(n): sum = int(input()) + int(input()) if len(str(sum)) >= 81: print 'overflow' else: print sum
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,236
s062281236
p00015
u708217907
1398210259
Python
Python
py
Accepted
20
4232
142
n = int(input()) for i in range(n): sum = long(input()) + long(input()) if len(str(sum)) >= 81: print 'overflow' else: print sum
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,237
s635131081
p00015
u703196441
1399627921
Python
Python
py
Accepted
20
4228
133
n = input() for i in range(n): m = input() + input() if len(str(m)) >= 81: print 'overflow' else: print m
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,238
s918662544
p00015
u491763171
1400482716
Python
Python
py
Accepted
10
4224
178
n = input() for _ in xrange(n): a, b = input(), input() ret = a + b overflow = 10 ** 80 if a + b >= overflow: print 'overflow' else: print ret
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,239
s147462878
p00015
u436634575
1401133867
Python
Python3
py
Accepted
40
6724
208
LIMIT = 10 ** 80 n = int(input()) for i in range(n): a = int(input()) b = int(input()) c = a + b if a >= LIMIT or b >= LIMIT or c >= LIMIT: print('overflow') else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,240
s885133412
p00015
u557208833
1402206887
Python
Python
py
Accepted
10
4276
844
import re def readline(): return raw_input() def split8by10(str): str = str.rjust(80,'0') ss = [] for s in range(0,len(str),8): ss.append(int(str[s:s+8])) return ss def add8by10(a,b): c = [0 for i in range(0,10)] p = 10**8 for i in reversed(range(0,10)): c[i] += a[i] +...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,241
s466971338
p00015
u814387366
1403081397
Python
Python
py
Accepted
10
4236
117
n=input() for i in range(0,n): a=input() b=input() s=str(a+b) if(len(s)<=80): print a+b else: print "overflow"
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,242
s098378217
p00015
u618672141
1403749000
Python
Python3
py
Accepted
30
6720
321
def digits(n): if n < 10: return 1 c = 0 while n > 0: c += 1 n = n // 10 return c n = int(input()) for i in range(n): u = int(input()) v = int(input()) s = u + v if (digits(u) > 80 or digits(v) > 80 or digits(s) > 80): print("overflow") else: print(s...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,243
s551902103
p00015
u986283797
1596604602
Python
Python3
py
Accepted
20
5652
199
# -*- coding: utf-8 -*- import math n=int(input()) for i in range(n): a=int(input()) b=int(input()) st=str(a+b) if len(st)>80: print("overflow") else: print(st)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,244
s695289806
p00015
u240091169
1594510785
Python
Python3
py
Accepted
20
5584
282
n = int(input()) for i in range(n) : a = input() b = input() if len(a) > 80 or len(b) > 80 : print("overflow") else : ans = str(int(a)+int(b)) if len(ans) > 80 : print("overflow") else : print(int(a) + int(b))
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,245
s780811280
p00015
u187074069
1593273221
Python
Python3
py
Accepted
20
5588
201
n = int(input()) for i in range(n): num1 = int(input()) num2 = int(input()) num3 = num1 + num2 k = len(str(num3)) if k > 80: print("overflow") else: print(num3)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,246
s196308092
p00015
u842461513
1588913023
Python
Python3
py
Accepted
20
5596
309
#標準入力 j = int(input()) for _ in range(j): a = int(input()) b = int(input()) #aとbの和を計算 num = a + b #桁数を調べ81以上であればoverflowを出力する num1 = [c for c in str(num)] if len(num1) > 80:num = "overflow" else:pass print(num)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,247
s458234980
p00015
u260980560
1588730267
Python
Python3
py
Accepted
30
5584
169
N = int(input()) for i in range(N): a = int(input()) b = int(input()) c = a+b if len(str(c)) > 80: print("overflow") else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,248
s100584393
p00015
u719330303
1588343354
Python
Python3
py
Accepted
20
5584
173
n = int(input()) for i in range(n): a = int(input()) b = int(input()) s = a + b if len(str(s)) > 80 : print("overflow") else: print(s)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,249
s920040922
p00015
u881891940
1587969695
Python
Python3
py
Accepted
20
5600
106
[print((lambda x:x if x<10**80 else "overflow")(int(input())+int(input()))) for i in range(int(input()))]
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,250
s655270040
p00015
u490578380
1584695954
Python
Python3
py
Accepted
20
5592
181
for i in range(int(input())): a = int(input()) b = int(input()) result = a + b if len(str(result)) > 80: print('overflow') else: print(result)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,251
s578237770
p00015
u668489394
1579072056
Python
Python3
py
Accepted
20
5588
263
if __name__ == '__main__': N = int(input()) for _ in range(N): a = input() b = input() c = str(int(a) + int(b)) if len(a) > 80 or len(b) > 80 or len(c) > 80: print("overflow") else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,252
s877995761
p00015
u630911389
1576297627
Python
Python3
py
Accepted
20
5588
378
while 1: try: n = int(input()) except:break n1 = 0 n2 = 0 for i in range(n): n1 = int(input()) n2 = int(input()) isOver = False ans = n1 + n2 if len(str(ans)) >= 81 | len(str(n1)) | len(str(n1)) : isOver = True if isOver: ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,253
s823632632
p00015
u617401892
1576252517
Python
Python3
py
Accepted
20
5596
256
N = int(input()) list = [] for n in range(0, N): tmp = [] for _ in range(0, 2): tmp.append(int(input())) list.append(tmp) for a, b in list: c = a + b if c >= 10 ** 80: print('overflow') else: print(str(c))
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,254
s550005894
p00015
u697145890
1575655707
Python
Python3
py
Accepted
40
6396
1,049
import heapq from collections import deque from enum import Enum import sys import math from _heapq import heappush, heappop import copy BIG_NUM = 2000000000 HUGE_NUM = 99999999999999999 MOD = 1000000007 EPS = 0.000000001 sys.setrecursionlimit(100000) num_query = int(input()) for _ in range(num_query): A = list...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,255
s657851493
p00015
u803862921
1570617068
Python
Python3
py
Accepted
30
5592
201
n = int(input()) for _ in range(n): a = int(input()) b = int(input()) c = a + b if max(len(str(a)), len(str(b)), len(str(c))) > 80: print("overflow") else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,256
s630408710
p00015
u824708460
1566184803
Python
Python3
py
Accepted
20
5592
163
n = int(input()) for i in range(n): a = int(input()) b = int(input()) if len(str(a + b)) > 80: print('overflow') else: print(a+b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,257
s046501788
p00015
u074302614
1565187498
Python
Python3
py
Accepted
20
5584
169
n = int(input()) for i in range(n): a = int(input()) b = int(input()) if (a + b) // (10 ** 80) > 0: print('overflow') else: print(a + b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,258
s798855088
p00015
u212392281
1564855127
Python
Python3
py
Accepted
20
5592
263
m = 100000000000000000000000000000000000000000000000000000000000000000000000000000000 n = int(input()) for i in range(n): a = int(input()) b = int(input()) sum = a + b if sum > m or sum == m: print("overflow") else: print(sum)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,259
s952892596
p00015
u108130680
1564847791
Python
Python3
py
Accepted
20
5584
151
n = int(input()) for i in range(n): s = int(input()) + int(input()) if len(str(s)) <= 80: print(s) else: print('overflow')
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,260
s362245830
p00015
u607723579
1564814702
Python
Python3
py
Accepted
20
5588
151
n = int(input()) for i in range(n): s = int(input()) + int(input()) if len(str(s)) <= 80: print(s) else: print('overflow')
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,261
s750154254
p00015
u313600138
1562855450
Python
Python3
py
Accepted
20
5584
138
n =int(input()) for i in range(n): a =int(input()) b=int(input()) if (a+b)<(10 **80): print(a+b) else: print("overflow")
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,262
s798263728
p00015
u051789695
1562423942
Python
Python3
py
Accepted
20
5588
158
n=int(input()) for i in range(n): a=input() b=input() s=int(a)+int(b) if len(str(s))>80: print("overflow") else: print(s)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,263
s929278861
p00015
u371539389
1560613124
Python
Python3
py
Accepted
20
5584
174
N=int(input()) for i in range(N): a=int(input()) b=int(input()) retval=a+b if len(str(retval))>80: print("overflow") else: print(retval)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,264
s220144218
p00015
u179046735
1560585396
Python
Python3
py
Accepted
20
5596
126
n=int(input()) for i in range(n): a,b=[int(input()) for _ in range(2)] print("overflow" if len(str(a+b))>80 else a+b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,265
s718488348
p00015
u548252256
1560161514
Python
Python3
py
Accepted
20
5588
175
if __name__ == '__main__': n = int(input()) for i in range(n): a = int(input()) b = int(input()) if len(str(a+b)) > 80: print("overflow") else: print(a+b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,266
s666831269
p00015
u506537276
1560144951
Python
Python3
py
Accepted
20
5588
249
n = int(input()) for i in range(n): a = input() b = input() if len(a) > 80 or len(b) > 80: print("overflow") else: aa = int(a) bb = int(b) c = str(aa + bb) if len(c) > 80: print("overflow") else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,267
s103917312
p00015
u625806423
1557058732
Python
Python3
py
Accepted
20
5584
144
n = int(input()) for i in range(n): a = int(input()) b = int(input()) if len(str(a+b)) > 80: print("overflow") else: print(a+b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,268
s226573019
p00015
u647694976
1554944713
Python
Python3
py
Accepted
20
5592
420
while True: try: N=int(input()) for i in range(N): a=input() b=input() if len(a)>80 or len(b)>80: print("overflow") else: a=int(a) b=int(b) s=a+b if len(str(s))>80: ...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,269
s818665792
p00015
u350155409
1553157543
Python
Python3
py
Accepted
20
5596
970
num_datasets = int(input()) for i in range(num_datasets): n = input().strip() m = input().strip() first_num_str = "" second_num_str = "" if len(n) > len(m): first_num_str = n second_num_str = m else: first_num_str = m second_num_str = n total = "" carry =...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,270
s111301741
p00015
u806257385
1548853458
Python
Python3
py
Accepted
20
5660
175
import math n=int(input()) s=[int(input()) for _ in range(n*2)] for i in range(n): a=s[i*2]+s[i*2+1] st=str(a) if len(st)>80: print("overflow") else: print(a)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,271
s462076538
p00015
u563075864
1542457434
Python
Python3
py
Accepted
20
5588
165
n = int(input()) for i in range(n): a = int(input()) b = int(input()) c = a+b if c >= (10**80): print("overflow") else: print(c)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,272
s330190250
p00015
u067299340
1542164498
Python
Python3
py
Accepted
20
5600
177
# N行の入力(Nが最初の行) n = int(input()) for _ in range(n): m1, m2 = int(input()), int(input()) print(m1 + m2 if len(str(m1 + m2)) <= 80 else 'overflow')
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,273
s428527473
p00015
u717526540
1541642630
Python
Python3
py
Accepted
20
5584
171
n = int(input()) for _ in range(n): a = int(input()) b = int(input()) s = a + b if len(str(s)) > 80: print("overflow") else: print(s)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,274
s256529192
p00015
u219940997
1537450297
Python
Python3
py
Accepted
20
5600
168
N = int(input()) num = [sum([int(input()) for _ in range(2)]) for _ in range(N)] for n in num: if n < 10**80: print(n) else: print('overflow')
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,275
s178231326
p00015
u536280367
1536938927
Python
Python3
py
Accepted
20
5612
811
# 12,432 -> 012,432 def align_digits(a, b): la, lb = len(a), len(b) if la < lb: a = a.zfill(lb) elif lb < la: b = b.zfill(la) return a, b def add(a, b): a, b = align_digits(a, b) zipped = list(zip(a[::-1], b[::-1])) carry = 0 result = [] for i, z in enumerate(zipped...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,276
s256962194
p00015
u319725914
1534220456
Python
Python3
py
Accepted
20
5588
175
n = int(input()) for _ in range(n): s1 = int(input()) s2 = int(input()) s3 = s1+s2 if len(str(s3)) > 80: print("overflow") else: print(s3)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,277
s994577967
p00015
u995990363
1533641566
Python
Python3
py
Accepted
20
5592
283
def run(): N = int(input()) for _ in range(N): x = int(input()) y = int(input()) if 80 < len(str(x)) or 80 < len(str(y)) or 80 < len(str(x+y)): print('overflow') else: print(x+y) if __name__ == '__main__': run()
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,278
s513146221
p00015
u252700163
1532774730
Python
Python3
py
Accepted
20
5588
152
n = int(input()) for i in range(n): a = int(input()) b = int(input()) s = a+b if len(str(s)) > 80: print("overflow") else: print(s)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,279
s283143443
p00015
u539753516
1532325902
Python
Python3
py
Accepted
20
5584
143
for i in range(int(input())): s=int(input())+int(input()) if s>=int("1"+"0"*80): print("overflow") else: print(s)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,280
s230522674
p00015
u853158149
1521973573
Python
Python3
py
Accepted
20
5584
158
n = int(input()) for i in range(n): a = int(input()) b = int(input()) if (a+b) < (10**80): print(a+b) else: print("overflow")
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,281
s815733945
p00015
u775669748
1502185946
Python
Python3
py
Accepted
20
7772
406
# -*- coding: utf-8 -*- import math BIG_NUM = 100000000000000000000000000000000000000000000000000000000000000000000000000000000 def main(): n = int(input()) for _ in range(n): a = int(input()) b = int(input()) if a >= BIG_NUM or b >= BIG_NUM or a + b >= BIG_NUM: print("o...
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,282
s349037587
p00015
u079141094
1467382875
Python
Python3
py
Accepted
20
7560
225
# National Budget md = 80 for _ in range(int(input())): a,b = int(input()),int(input()) ab = a + b if a >= pow(10,md) or b >= pow(10,md) or ab >= pow(10,md): print('overflow') else: print(a+b)
p00015
<H1>National Budget</H1> <p> A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. </p> <p> Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of...
6 1000 800 9999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 1 99999999999999999999999999999999999999999999999999999999999999999999999999999999 0 100000000000000000000000000000000000000000000000000000000000000000000000000000000 1 1000000000000000...
1800 10000000000000000000000000000000000000000 overflow 99999999999999999999999999999999999999999999999999999999999999999999999999999999 overflow overflow
6,283
s487301613
p00016
u352394527
1530879501
Python
Python3
py
Accepted
20
5720
242
import math x, y = 0, 0 angle = math.pi / 2 while True: d, a = map(int, input().split(",")) if (d, a) == (0, 0): break x += math.cos(angle) * d y += math.sin(angle) * d angle -= a * math.pi / 180 print(int(x), int(y), sep="\n")
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,284
s295482187
p00016
u244742296
1409889291
Python
Python3
py
Accepted
30
6864
299
import math import cmath coordinates = 0 ang = 90 while True: line = list(map(float, input().split(","))) if line[0] == 0 and line[1] == 0: break coordinates += cmath.rect(line[0], math.radians(ang)) ang -= line[1] print(int(coordinates.real)) print(int(coordinates.imag))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,285
s061256234
p00016
u733620181
1409915329
Python
Python
py
Accepted
20
4420
279
import math x, y = 0, 0 angle = 90 while True: line = map(int, raw_input().split(',')) if line[0] == 0 and line[1] == 0: break radian = math.radians(angle) x += math.cos(radian) * line[0] y += math.sin(radian) * line[0] angle -= line[1] print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,286
s118798062
p00016
u579833671
1410770271
Python
Python
py
Accepted
20
4416
277
import math x = 0 y = 0 degree = 0 while(True): a = map(int, raw_input().split(",")) if(a[0] == 0 and a[1] == 0): break x += a[0] * math.sin(math.radians(degree)) y += a[0] * math.cos(math.radians(degree)) degree += a[1] print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,287
s651233269
p00016
u506132575
1416120136
Python
Python
py
Accepted
10
4432
380
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import math def move(point,n,arg): return [ point[0]+n*arg[0], point[1]+n*arg[1] ] theta = 90 p = [0.0,0.0] for s in sys.stdin: d = map(int , s.split(",")) arg = [ math.cos(theta*math.pi/180), math.sin(theta*math.pi/180) ] p = move(p,d[0],arg) theta...
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,288
s336184787
p00016
u193025715
1417417038
Python
Python3
py
Accepted
30
6852
371
#!/usr/bin/python # AOJ # 0016 import math degree = 90 x = 0 y = 0 while True: a, b = map(int, input().split(',')) if a is 0 and b is 0: break x += a * math.cos(math.radians(degree)) y += a * math.sin(math.radians(degree)) degree -= b if degree > 360: degree -= 360 elif degree < 0...
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,289
s755847749
p00016
u567380442
1422795017
Python
Python3
py
Accepted
30
6864
315
import sys f = sys.stdin import math, cmath direction = 1j location = 0 + 0j while True: step, degrees = map(int, f.readline().split(',')) location += direction * step direction *= cmath.rect(1, math.radians(-degrees)) if step == 0: break print(int(location.real)) print(int(location.imag))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,290
s490955262
p00016
u540744789
1425799376
Python
Python
py
Accepted
20
4420
261
import math now_r=0 now_x=0 now_y=0 while True: n,r=map(int,raw_input().split(",")) if n==0 and r==0: break now_x+=n*math.sin((now_r/180.0)*math.pi) now_y+=n*math.cos((now_r/180.0)*math.pi) now_r+=r print int(now_x) print int(now_y)
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,291
s158968516
p00016
u744114948
1425901593
Python
Python3
py
Accepted
30
6852
223
import math x=0 y=0 angle=0 while True: r,c=map(int, input().split(",")) if r == c == 0: break y += r*math.cos(angle) x += r*math.sin(angle) angle -= c*math.pi/180 print(int(-x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,292
s690762650
p00016
u067299340
1433153915
Python
Python
py
Accepted
20
4392
147
import sys,math x=y=r=0 m=3.14/180 for l in sys.stdin: h,w=map(int,l.split(",")) x+=h*math.sin(r*m) y+=h*math.cos(r*m) r+=w print"%d\n%d"%(x,y)
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,293
s193894850
p00016
u067299340
1433153992
Python
Python
py
Accepted
10
4392
147
import sys,math x=y=r=0 m=3.14/180 for l in sys.stdin: h,w=map(int,l.split(",")) x+=h*math.sin(r*m) y+=h*math.cos(r*m) r+=w print"%d\n%d"%(x,y)
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,294
s501557911
p00016
u873482706
1434438309
Python
Python
py
Accepted
20
5928
607
from decimal import Decimal import math def walk(x, y, distance, angle, next_angle): radian = math.radians(angle) _x = Decimal(distance * math.cos(radian) + x) x = round(_x, 6) _y = Decimal(distance * math.sin(radian) + y) y = round(_y, 6) angle = angle - next_angle return x, y, angle ...
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,295
s037324768
p00016
u379956761
1434851348
Python
Python3
py
Accepted
30
6852
270
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math gx = 0 gy = 0 th = 90 for s in sys.stdin: x, rot = map(int, s.split(',')) gx += x * math.cos(th/180*math.pi) gy += x * math.sin(th/180*math.pi) th -= rot print(int(gx)) print(int(gy))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,296
s630177578
p00016
u071010747
1445236139
Python
Python3
py
Accepted
30
7744
426
# -*- coding:utf-8 -*- def main(): import math LIST=[0,0,math.radians(90)] while True: a,b=map(float,input().split(",")) if a==0 and b==0: break else: b=math.radians(b) LIST[0]+=a*math.sin(LIST[2]) LIST[1]+=a*math.cos(LIST[2]) ...
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,297
s676890771
p00016
u775586391
1448032976
Python
Python3
py
Accepted
20
7844
216
import math x,y,r = 0,0,90 while True: m,n = map(int,input().split(',')) if (m,n) == (0,0): break y += m * math.sin(math.radians(r)) x += m * math.cos(math.radians(r)) r -= n print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,298
s558855271
p00016
u461370825
1449737910
Python
Python
py
Accepted
10
6660
286
x = 0 y = 0 an = 0 from math import * PI = 3.1415926535898 while True: try: st, ag = map(float, raw_input().strip().split(',')) if st == 0 and ag == 0: print int(x) print int(y) else: x += st*sin(an*PI/180) y += st*cos(an*PI/180) an += ag except EOFError: break
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,299
s918769557
p00016
u747479790
1449887628
Python
Python3
py
Accepted
20
7916
214
# 0016 import math as m x,y,d=0,0,90 while True: r,t=map(int,input().split(",")) if (r,t)==(0,0): break x+=r*m.cos(m.radians(d)) y+=r*m.sin(m.radians(d)) d-=t print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,300
s542765043
p00016
u777299405
1450851384
Python
Python3
py
Accepted
20
7868
236
import math x, y, r = 0, 0, 90 while True: d, t = map(float, input().split(",")) if d == t == 0: break x += d * math.cos(math.radians(r)) y += d * math.sin(math.radians(r)) r -= t print(int(x)) print(int(y))
p00016
<H1>Treasure Hunt</H1> <p> When a boy was cleaning up after his grand father passing, he found an old paper: </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br> </center> <br/> <!-- <center> <table> <tr> <td align="top"> <img src="https://judgeapi.u-aizu.ac.jp/resources/im...
56,65 97,54 64,-4 55,76 42,-27 43,80 87,-86 55,-6 89,34 95,5 0,0
171 -302
6,301