# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
309966 | tengiz05 | Robots (IOI13_robots) | C++17 | 2340 ms | 61048 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>
const int inf = 2e9+7;
using namespace std;
int putaway(int n, int m, int t, int a[], int b[], int w[], int s[]) {
int mxa = 0, mxb = 0;
for(int i=0;i<n;i++)mxa = max(mxa, a[i]);
for(int i=0;i<m;i++)mxb = max(mxb, b[i]);
for(int i=0;i<t;i++){
if(mxa <= w[i] && mxb <= s[i])return -1;
}
multiset<pair<int, int>> wtoys;
multiset<pair<int, int>> stoys;
// weak_toys[i] = {weight, size}
// small_toys[i] = {size, weight}
for(int i=0;i<t;i++){
wtoys.insert({w[i], s[i]});
stoys.insert({s[i], w[i]});
}
multiset<pair<int, int>> robots;
for(int i=0;i<n;i++){
robots.insert({a[i], 0});
}for(int i=0;i<m;i++){
robots.insert({b[i], 1});
}
int level = 0;
while(wtoys.size()){
level++;
set<pair<int, int>> black_list;
# | 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... |