이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "robots.h"
int XG[1001], YG[1001], WG[1001], SG[1001], AG, BG, TG;
bool suit(int t, bool type, int r) { /* true if weak, false if small */
if(type and WG[t] >= XG[r]) return false;
if(!type and SG[t] >= YG[r]) return false;
return true;
}
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
AG=A, BG=B, TG=T;
for(int i=0; i<T; i++) {
WG[i] = W[i];
SG[i] = S[i];
}
for(int i=0; i<A; i++) XG[i] = X[i];
for(int i=0; i<B; i++) YG[i] = Y[i];
if(T==2 and (A+B)==2) {
if(A==2) {
if( (suit(0, true,0) and suit(1, true, 1) ) or ( suit(0,true,1) and suit(1,true,0) ) ) return 1;
else if( (suit(0, true,0) and suit(1, true, 0) ) or ( suit(0,true,1) and suit(1,true,1) ) ) return 2;
return -1;
}
if(B==2) {
if( (suit(0, false,0) and suit(1, false, 1) ) or ( suit(0,false,1) and suit(1,false,0) ) ) return 1;
else if( (suit(0, false,0) and suit(1, false, 0) ) or ( suit(0,false,1) and suit(1,false,1) ) ) return 2;
return -1;
}
if( (suit(0, false,0) and suit(1, true, 0) ) or ( suit(0,true,0) and suit(1,false,0) ) ) return 1;
else if( (suit(0, false,0) and suit(1, false, 0) ) or ( suit(0,true,0) and suit(1,true,0) ) ) return 2;
return -1;
}
return 42;
}
# | 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... |