# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
211715 | 2020-03-21T05:00:22 Z | goodboy | Potatoes and fertilizers (LMIO19_bulves) | C++14 | 19 ms | 16256 KB |
#include <stdio.h> #include <math.h> using namespace std; int fertiliser[1000005],potatoes[1000005]; int main() { int n , a , b; scanf("%d",&n); int pot = 0, fert = 0; for (int i = 1; i <= n; i++) { scanf("%d%d",&a,&b); for (int j = 1; j <= a; j++) { fert++; fertiliser[fert] = i; } for (int j = 1; j <= b; j++) { pot++; potatoes[pot] = i; } } long long ans = 0; for(int i = 1; i <= pot; i++)ans += abs(fertiliser[i] - potatoes[i]); printf("%lld\n",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 128 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Runtime error | 19 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 128 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Runtime error | 19 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 128 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Incorrect | 4 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 128 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Runtime error | 19 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 128 KB | Output is correct |
2 | Correct | 5 ms | 256 KB | Output is correct |
3 | Runtime error | 19 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |