# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714521 | mseebacher | Robots (IOI13_robots) | C++17 | 691 ms | 37748 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 <bits/stdc++.h>
using namespace std;
#include "robots.h"
typedef long long ll;
typedef vector<int> vi;
#define MAXI (int)1e5
#define pb(x) push_back(x)
vector<int> ad[MAXI];
vector<bool> vis(MAXI,0);
void dfs(int x){
if(vis[x]) return;
vis[x] = 1;
for(auto s:ad[x]){
dfs(s);
}
}
void setIO(string s) {
freopen((s + ".in").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
int putaway(int A,int B,int T, int X[],int Y[],int W[],int S[]){
sort(X,X+A);
sort(W,W+T);
if(W[T-1] >= X[A-1]) return -1;
multiset<int> se;
for(int i = 0;i<T;i++) se.insert(W[i]);
multiset<int> av;
int time = 0;
multiset<int>::reverse_iterator it;
while(!se.empty()){
++time;
for(int i = 0;i<A;i++) av.insert(X[i]);
vector<int> loe;
for(it = se.rbegin();it != se.rend();it++){
if(av.size() == 0) break;
if(*av.rbegin() > *it){
av.erase(av.find(*av.rbegin()));
loe.push_back(*it);
}
}
for(int i = 0;i<(int)loe.size();i++){
se.erase(se.find(loe[i]));
}
}
return time;
}
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... |