Submission #1073725
Source Code Expand
#include<cstdio> #include<iostream> #include<cmath> #include<vector> #include<string> #include<algorithm> #include<queue> #include<stack> #include<map> #include<set> #include<iomanip> #include<fstream> #define rep(i,a,N) for(int i=0+a;i<N;i++) #define lint long long int #define SIZE 100005 #define pb push_back #define MP make_pair using namespace std; int main(){ lint a[SIZE],b[SIZE]; lint n,ans=0; cin>>n; rep(i,0,n){ cin>>a[i]>>b[i]; } for(int i=n-1;i>=0;i--){ if((a[i]+ans)%b[i]!=0){ ans+=b[i]-(a[i]+ans)%b[i]; } } cout<<ans; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Array |
User | Aslan168 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 600 Byte |
Status | WA |
Exec Time | 147 ms |
Memory | 1792 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 134 ms | 1792 KB |
02.txt | WA | 133 ms | 1792 KB |
03.txt | WA | 134 ms | 1792 KB |
04.txt | WA | 134 ms | 1792 KB |
05.txt | WA | 134 ms | 1792 KB |
06.txt | WA | 113 ms | 1792 KB |
07.txt | WA | 84 ms | 1792 KB |
08.txt | WA | 140 ms | 1792 KB |
09.txt | WA | 85 ms | 1792 KB |
10.txt | WA | 140 ms | 1792 KB |
11.txt | WA | 70 ms | 1792 KB |
12.txt | WA | 36 ms | 1792 KB |
13.txt | WA | 86 ms | 1792 KB |
14.txt | WA | 147 ms | 1792 KB |
15.txt | WA | 3 ms | 256 KB |
16.txt | WA | 2 ms | 256 KB |
s1.txt | WA | 2 ms | 256 KB |
s2.txt | WA | 2 ms | 256 KB |