# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
426552 | SAAD | Robots (IOI13_robots) | C++17 | 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.
#define F first
#define S second
#define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1))
#define pb push_back
#define Fbitl __builtin_ffs
#define bit1 __builtin_popcount
//#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
int putaway(int A,int B,int T,int X[],int Y[],int W[],int S[]) {
vector <int> x;
for (int i = 0 ; i < T;i++)
x.pb(W[i]);
int c = A , res = 0 ;
sort(X,X+A);sort(x.begin(),x.end());
while ( T ) {
if ( X[A-1] < x[T-1] ) return -1 ;
for (int i = T-1; i >= 0;i--){
if ( x[i] <= X[c-1] ) {
T--;
x[i] = 0 ;
c--;
}
}
res++;
sort(x.begin(),x.end());
}
return res ;
}