# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
211717 | 2020-03-21T05:04:42 Z | goodboy | Potatoes and fertilizers (LMIO19_bulves) | C++14 | 18 ms | 16256 KB |
#include <bits/stdc++.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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Runtime error | 18 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Runtime error | 18 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Incorrect | 5 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Runtime error | 18 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Runtime error | 18 ms | 16256 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |