# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92900 | stefdasca | Robots (IOI13_robots) | C++14 | 2040 ms | 24472 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.
/*
As it is usual for such problems, we can binary search the answer
At each step, we will try to assign toys to the weak robots, then to the small robots. Since we will use a priority queue, checking will be done
at each step in O(T log T)
Therefore, the total complexity will be O(T log^2 T)
*/
#include"robots.h"
#include<bits/stdc++.h>
using namespace std;
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[])
{
int j = 0;
sort(X, X+A);
sort(Y, Y+B);
vector<pair<int, int> >v;
for(int i = 0; i < T; ++i)
v.push_back({W[i], S[i]});
sort(v.begin(), v.end());
int b = 0;
int e = 10000002;
bool findd = 0;
int ans = 0;
while(b <= e)
{
int mid = (b + e) / 2;
priority_queue<int>D;
Compilation message (stderr)
# | 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... |