# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
534855 | bonk | Robots (IOI13_robots) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#include "robots.h"
using namespace std;
using ll = long long;
int putaway(int a, int b, int t, vector<int>x, vector<int>y, vector<int>w, vector<int>s){
sort(x.begin(), x.end(), greater<int>());
sort(y.begin(), y.end(), greater<int>());
if(t == 2 && (a + b == 2)){
if(a == 2){
if((x[0] >= w[0] && x[1] >= w[1]) || (x[0] >= w[1] && x[1] >= w[0])){
return 1;
} else if(x[0] >= w[0] && x[0] >= w[1]){
return 2;
} else{
return -1;
}
} else if(b == 2){
if((y[0] >= s[0] && y[1] >= s[1]) || (y[0] >= s[1] && y[1] >= s[0])){
return 1;
} else if(y[0] >= s[0] && y[0] >= s[1]){
return 2;
} else{
return -1;
}
} else{
if((x[0] >= w[0] && y[0] >= s[1]) || (x[0] >= w[1] && y[0] >= s[0])){
return 1;
} else if((x[0] >= w[0] && x[0] >= w[1]) || (y[0] >= s[0] && y[0] >= s[1])){
return 2;
} else{
return -1;
}
}
}
return 0;
}