# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
309342 | amunduzbaev | 로봇 (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 "robots.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
const int N=1e4+5;
int putaway(int wet, int smt, int T, int we[], int sm[], int wt[], int st[]) {
int t=T;
if(t==2){
sort(we,we+wet);
sort(sm,sm+smt);
for(int i=0;i<t;i++){
//cout<<wt[i]<<" "<<st[i]<<"\n";
if(wt[i]>we[wet-1]&&st[i]>sm[smt-1]) return -1;
}
if(wet&&smt){
if(we[0]>=wt[1]&&sm[0]>=st[0]||we[0]>=wt[0]&&sm[0]>=st[1]) return 1;
}
if(wet==t){
if(wt[0]<=we[1]&&wt[1]<=we[0]||wt[1]<=we[1]&&wt[0]<=we[0]) return 1;
}
if(smt==t){
if(st[0]<=sm[1]&&st[1]<=sm[0]||st[1]<=sm[1]&&st[0]<=sm[0]) return 1;
}
return 2;
}
}