# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211767 | 2020-03-21T08:08:22 Z | goodboy | Potatoes and fertilizers (LMIO19_bulves) | C++14 | 146 ms | 4600 KB |
#include <stdio.h> #include <math.h> using namespace std; int main() { int n , a , b; scanf("%d",&n); long long ans = 0 , prefix = 0; for (int i = 1; i <= n; i++) { scanf("%d%d",&a,&b); prefix += (a-b); ans += abs(prefix); } printf("%lld\n",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 15 ms | 256 KB | Output is correct |
5 | Correct | 26 ms | 256 KB | Output is correct |
6 | Correct | 75 ms | 256 KB | Output is correct |
7 | Correct | 146 ms | 256 KB | Output is correct |
8 | Correct | 114 ms | 376 KB | Output is correct |
9 | Correct | 120 ms | 4600 KB | Output is correct |
10 | Correct | 104 ms | 2300 KB | Output is correct |
11 | Correct | 101 ms | 2296 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 15 ms | 256 KB | Output is correct |
5 | Correct | 26 ms | 256 KB | Output is correct |
6 | Correct | 75 ms | 256 KB | Output is correct |
7 | Correct | 146 ms | 256 KB | Output is correct |
8 | Correct | 114 ms | 376 KB | Output is correct |
9 | Correct | 120 ms | 4600 KB | Output is correct |
10 | Correct | 104 ms | 2300 KB | Output is correct |
11 | Correct | 101 ms | 2296 KB | Output is correct |
12 | Incorrect | 41 ms | 2040 KB | Output isn't correct |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Incorrect | 4 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Incorrect | 4 ms | 256 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Incorrect | 4 ms | 256 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |