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;
int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) {
vector<array<int, 2>> toys(t);
for (int i = 0; i < t; i++)
{
toys[i][0] = w[i];
toys[i][1] = s[i];
}
int res = 0;
set<int> sett;
for (int i = 0; i < t; i++) sett.insert(w[i]);
sort(x, x + a);
if (*sett.rbegin() >= x[a - 1]) return -1;
while (!sett.empty())
{
for (int i = a - 1; i >= 0; i--)
{
auto it = sett.lower_bound(x[i]);
if (it == sett.begin()) break;
sett.erase(it);
}
res++;
}
return res;
}
# | 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... |