| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1036265 | beaconmc | 로봇 (IOI13_robots) | C++14 | 777 ms | 19700 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 "robots.h"
#include <bits/stdc++.h>
typedef int ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
using namespace std;
bool sus(vector<ll> stuff, vector<ll> robot, ll k){
sort(stuff.begin(), stuff.end());
sort(robot.begin(), robot.end());
ll cur = 0;
for (auto&i : robot){
ll cnt = 0;
while (cur < stuff.size() && cnt < k){
if (stuff[cur] < i) cur++, cnt++;
else break;
}
}
if (cur == stuff.size()) return true;
else return false;
}
int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) {
vector<ll> x;
vector<ll> w;
FOR(i,0,A) x.push_back(X[i]);
FOR(i,0,T) w.push_back(W[i]);
ll l = 0;
ll r = T+1;
while (l<r){
ll mid = (l+r)/2;
if (sus(w,x,mid)) r = mid;
else l = mid+1;
}
if (l==T+1) return -1;
else return l;
}
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... | ||||
