Submission #1308370
Source Code Expand
n=int(raw_input()) a=[] b=[] for i in xrange(n): A,B=map(int,raw_input().split()) a.append(A) b.append(B) ans=0 for i in xrange(n-1,-1,-1): if (a[i]+ans)%b[i]!=0: ans+=b[i]-(a[i]+ans)%b[i] print ans
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Array |
User | roto_37 |
Language | Python (2.7.6) |
Score | 300 |
Code Size | 233 Byte |
Status | AC |
Exec Time | 312 ms |
Memory | 9012 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | AC | 275 ms | 8964 KB |
02.txt | AC | 285 ms | 8964 KB |
03.txt | AC | 287 ms | 8964 KB |
04.txt | AC | 276 ms | 8964 KB |
05.txt | AC | 285 ms | 8964 KB |
06.txt | AC | 274 ms | 8964 KB |
07.txt | AC | 248 ms | 6572 KB |
08.txt | AC | 272 ms | 8964 KB |
09.txt | AC | 251 ms | 6572 KB |
10.txt | AC | 312 ms | 8964 KB |
11.txt | AC | 247 ms | 9012 KB |
12.txt | AC | 247 ms | 4296 KB |
13.txt | AC | 273 ms | 9012 KB |
14.txt | AC | 269 ms | 8964 KB |
15.txt | AC | 10 ms | 2568 KB |
16.txt | AC | 10 ms | 2568 KB |
s1.txt | AC | 10 ms | 2568 KB |
s2.txt | AC | 10 ms | 2568 KB |