Submission #309966

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3099662020-10-05 05:23:03tengiz05Robots (IOI13_robots)C++17
100 / 100
2340 ms61048 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...