# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29918 | kavun | Robots (IOI13_robots) | C++14 | 0 ms | 6320 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |