Submission #1073894
Source Code Expand
// acdart #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> #include <cctype> #include <string> #include <queue> #include <vector> #include <stack> #include <set> #include <map> #include <cstdlib> /*********default*********/ long long a[10010], b[10010]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%lld%lld", &a[i], &b[i]); } long long x = 0; for (int i = n - 1; i >= 0; --i){ a[i] += x; if (a[i] % b[i] != 0){ x += (b[i] - a[i] % b[i]); } } printf("%lld\n", x); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Array |
User | acdart |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 630 Byte |
Status | RE |
Exec Time | 113 ms |
Memory | 384 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:24:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ ./Main.cpp:26:34: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lld%lld", &a[i], &b[i]); ^
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 | RE | 113 ms | 384 KB |
02.txt | RE | 113 ms | 384 KB |
03.txt | RE | 112 ms | 384 KB |
04.txt | RE | 112 ms | 384 KB |
05.txt | RE | 113 ms | 384 KB |
06.txt | RE | 112 ms | 384 KB |
07.txt | RE | 112 ms | 384 KB |
08.txt | RE | 112 ms | 384 KB |
09.txt | RE | 112 ms | 384 KB |
10.txt | RE | 113 ms | 384 KB |
11.txt | RE | 112 ms | 384 KB |
12.txt | RE | 113 ms | 384 KB |
13.txt | RE | 112 ms | 384 KB |
14.txt | RE | 113 ms | 384 KB |
15.txt | AC | 2 ms | 256 KB |
16.txt | AC | 2 ms | 256 KB |
s1.txt | AC | 2 ms | 256 KB |
s2.txt | AC | 2 ms | 256 KB |