This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// ~ Be Name Khoda ~ //
#include "robots.h"
#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second
const int maxn = 1e6 + 10;
const int maxn5 = 5e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e18;
bool mark[maxn5];
int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) {
sort(w, w + t);
sort(x, x + a);
int ans = 0, rem = t;
//cout << w[t - 1] << ' ' << x[a - 1] << endl;
if(w[t - 1] >= x[a - 1])
return -1;
while(rem){
int ind = a - 1;
ans++;
for(int i = t - 1; i >= 0; i--) if(!mark[i] && ind >= 0 && x[ind] > w[i]){
mark[i] = true;
ind--;
rem--;
}
}
return ans;
}
# | 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... |