# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
30634 | 2017-07-25T16:57:50 Z | waleed_jubeh | Boxes with souvenirs (IOI15_boxes) | C++14 | 2 ms | 376 KB |
#include "boxes.h" #include<algorithm> #include<map> using namespace std; long long delivery(int N, int K, int L, int p[]) { map<int,bool>visited; int diameter=L/2; long long int cost=0; long long int remain=0; for(int i=0;i<N;i++) { if(!visited[p[i]]){ if(p[i]>diameter){ if(abs(p[i]-cost)>L-p[i]) cost+=L-p[i]+cost; else cost+=p[i]-cost; }else{ cost+=p[i]-cost; } visited[p[i]]++; } if(i==N-1) if(L-p[i]<p[i]) cost+=L-p[i]; else cost+=p[i]; } return cost; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 348 KB | Output is correct |
4 | Incorrect | 2 ms | 348 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 292 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |