# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29918 | 2017-07-21T10:41:42 Z | kavun | Robots (IOI13_robots) | C++14 | 0 ms | 6320 KB |
#include "robots.h" #include <bits/stdc++.h> using namespace std; int maxsize, maxweight, minweight = 1e9, minsize = 1e9; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { for(int i = 0; i < A; i++) maxweight = max(maxweight,X[i]); for(int i = 0; i < B; i++) maxsize = max(maxsize,Y[i]); for(int i = 0; i < T; i++) minweight = min(minweight,W[i]), minsize = min(minsize,S[i]); for(int i = 0; i < T; i++) if(W[i] > maxweight && S[i] > maxsize) return -1; if(T == 2 && A+B == 2) { if(A == 2 && B == 0) { sort(X,X+2); if(X[0] < minweight) return 2; else return 1; } else if(A == 1 && B == 1) { return 1; } else { sort(Y,Y+2); if(Y[0] < minsize) return 2; else return 1; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 6320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 6320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 6320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 6320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 6320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |