Submission #718221

#TimeUsernameProblemLanguageResultExecution timeMemory
718221nihaddhuseynliRobots (IOI13_robots)C++14
14 / 100
3047 ms19148 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; typedef long long int ll; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { ll ans; ll check[T+5]; memset(check,0,sizeof(check)); for(int i =0;i<A;i++) { for(int j=0;j<T;j++) { if(W[j]<X[i]) { check[j]++; } } } for(int i =0;i<B;i++) { for(int j=0;j<T;j++) { if(S[j]<Y[i]) { check[j]++; } } } for(int i =0;i<T;i++) { if(check[i]==0) { return -1; } } if(A==1 && B==1) { ans=1; } else { if(X[0]>min(W[0],W[1]) && X[1]>max(W[0],W[1])) { ans=1; } else if(X[1]>min(W[0],W[1]) && X[0]>max(W[0],W[1])) { ans=1; } else if(Y[0]>min(S[0],S[1]) && Y[1]>max(S[0],S[1])) { ans=1; } else if(Y[1]>min(S[0],S[1]) && Y[0]>max(S[0],S[1])) { ans=1; } else { ans=2; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...