Submission #1058951

#TimeUsernameProblemLanguageResultExecution timeMemory
1058951oscarsierra12Robots (IOI13_robots)C++14
0 / 100
1 ms4444 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back typedef long long ll; typedef pair <ll,ll> pii; const ll N = 110; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { sort (X, X + A); sort (W, W + T); int lw = 0, hg = T; while (lw <= hg) { int mi = (lw + hg) / 2; int idx = A - 1; int can = 1; vector <int> use (A, 0); for (int i = T - 1; i >= 0; --i) { while (idx >= 0 && (use[idx] == mi || X[idx] <= W[i])) idx--; if (idx < 0) { can = 0; break; } use[idx]++; } if (can) hg = mi - 1; else lw = mi + 1; } if (hg == T + 1) return -1; return hg; }
#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...