Submission #1080717

#TimeUsernameProblemLanguageResultExecution timeMemory
1080717GrayRobots (IOI13_robots)C++17
14 / 100
191 ms22076 KiB
#include "robots.h" #include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define ln "\n" using namespace std; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { vector<ll> robot(A), toy(T); for (ll i=0; i<A; i++) robot[i]=X[i]; for (ll i=0; i<T; i++) toy[i]=W[i]; sort(robot.rbegin(), robot.rend()); sort(toy.rbegin(), toy.rend()); ll l=0; multiset<ll> usd; for (ll i=0; i<T; i++){ while (l<A and robot[l]>toy[i]){ usd.insert(0); l++; } if (usd.empty()) return -1; ll val = *usd.begin(); usd.erase(usd.begin()); usd.insert(val+1); } return *usd.rbegin(); }
#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...