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 <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;
if(bya%A)
ans++;
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 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... |