#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;
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 8 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |