|
|
back to boardHELP ME (TIME LIMIT EXCEEDED) !! Python how to do import sys n = input() arr = bytearray(n) i = 0 while i < n: line = raw_input().split() arr[i] = (int(line[0]) + int(line[1])) i += 1 result = "" i = n-1 while i > 0: if arr[i] > 9: arr[i] -= 10 arr[i-1] += 1 result = str(arr[i]) + result i -= 1
arr[0] = arr[0]%10 result = str(arr[0]) + result print result Re: HELP ME (TIME LIMIT EXCEEDED) !! Python how to do result = str(arr[i]) + result Run this code 1M iterations locally. |
|
|