# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
135790 | mirbek01 | Robots (IOI13_robots) | C++11 | 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.
#include "robots.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2;
int n, used[N];
vector <int> x, y, w, s;
vector < pair <int, int> > v1, v2;
bool check(int c){
memset(used, 0, sizeof(used));
int pt = -1, sz = (int)x.size();
set < pair <int, int> > st;
for(int i = 0; i < sz; i ++){
while(pt + 1 < n && v1[pt + 1].first < x[i]){
pt ++;
st.insert( {-s[ v1[pt].second ], v1[pt].second} );
}
int cn = c;
while(cn > 0 && !st.empty()){
cn --;
int id = st.begin()->second;
st.erase(st.begin());
used[id] = 1;
}
}
stack <int> stk;