# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
657439 | PanTkd | Robots (IOI13_robots) | C++14 | 0 ms | 0 KiB |
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 <stdio.h>
#include <stdlib.h>
#include "robots.h"
#include <iostream>
using namespace std;
typedef long long ll;
#define fail(s, x...) do { \
fprintf(stderr, s "\n", ## x); \
exit(1); \
} while(0)
#define MAX_A 50000
#define MAX_B 50000
#define MAX_T 500000
static int X[MAX_A];
static int Y[MAX_B];
static int W[MAX_T];
static int S[MAX_T];
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
ll ans=1;
ll i = 0 , j = 0 ;
sort(X.begin(),X.end());
sort(W.begin(),W.end());
reverse(X.begin(),X.end());
reverse(W.begin(),W.end());
if(X[0]<=W[0]) return -1;
while(1){
if(X[i]>W[j]){
i++,j++;
}
else{
i = 0;
ans++;
}
}
return ans;
}