Submission #1074381


Source Code Expand

import numpy as np

N = int(raw_input())

a = np.zeros(N).astype(np.float)
b = np.zeros(N).astype(np.float)

for n in range(N):
    a[n], b[n] = map(int, raw_input().split())

total = 0
for i in range(N-1, -1, -1):
    n_push = np.ceil(a[i] / b[i]) * b[i] - a[i]
    total +=  n_push
    a[0:i] += n_push

print int(total)

Submission Info

Submission Time
Task A - Multiple Array
User akaenhira1111
Language Python (2.7.6)
Score 0
Code Size 338 Byte
Status TLE
Exec Time 2103 ms
Memory 15148 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 4
TLE × 14
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt TLE 2103 ms 15148 KB
02.txt TLE 2103 ms 15148 KB
03.txt TLE 2103 ms 15148 KB
04.txt TLE 2103 ms 15148 KB
05.txt TLE 2103 ms 15148 KB
06.txt TLE 2103 ms 15148 KB
07.txt TLE 2103 ms 15148 KB
08.txt TLE 2103 ms 15148 KB
09.txt TLE 2103 ms 15148 KB
10.txt TLE 2103 ms 15148 KB
11.txt TLE 2103 ms 15148 KB
12.txt TLE 2103 ms 15148 KB
13.txt TLE 2103 ms 15148 KB
14.txt TLE 2103 ms 15148 KB
15.txt AC 114 ms 10420 KB
16.txt AC 114 ms 10420 KB
s1.txt AC 113 ms 10420 KB
s2.txt AC 114 ms 10420 KB