제출 #470069

#제출 시각아이디문제언어결과실행 시간메모리
470069Carmel_Ab1로봇 (IOI13_robots)C++17
0 / 100
1 ms332 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll>vl; #define all(x) x.begin(),x.end() #define pb push_back int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { int bya=0,byb=0,both=0; for(int i=0; i<T; i++){ bool oka=0,okb=0; for(int j=0; j<A; j++) if(W[i]<X[j]) oka=1; for(int j=0; j<B; j++) if(S[i]<Y[j]) okb=1; if(oka && okb) both++; else if(oka) bya++; else if(okb) byb++; else return -1; } int ans=0; ans+=bya/A + byb/B; bya%=A,byb%=B; if(!both)return ans+(bya!=0)+(byb!=0); return ans; } /* int main(){ int A,B,T; cin >> A >> B >> T; int X[A]; for(int i=0; i<A; i++) cin >> X[i]; int Y[B]; for(int i=0; i<B; i++) cin >> Y[i]; int W[T],S[T]; for(int i=0; i<T; i++) cin >> W[i] >> S[i]; cout << putaway(A,B,T,X,Y,W,S); return 0; }*/
#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...