Submission #1069429

#TimeUsernameProblemLanguageResultExecution timeMemory
1069429allin27xRobots (IOI13_robots)C++17
14 / 100
146 ms15476 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; int putaway(int a, int b, int t, int X[], int Y[], int W[], int S[]){ for (int i=0; i<t; i++) W[i]++; sort(X, X+a); sort(Y, Y+b); sort(W, W+t); if (W[t-1] > X[a-1]) return -1; int mc = a-1; int toy = t-1; int cnt = 0; vector<int> exc(a, 0); while (mc){ while (X[mc-1] < W[toy]) toy--, cnt++; exc[mc] = cnt; cnt = 0; mc--; } exc[mc] = toy+1; // for (int i=0; i<a; i++) cout<<exc[i]<<' '; int ans = 1; for (int i=a-2; i>=0; i--) exc[i] = exc[i+1]+exc[i]; for (int i=0; i<a; i++) ans = max(ans, (exc[i]+a-1-i)/(a-i)); return ans; } /* 5 0 9 1 5 6 8 30 5 0 5 0 3 0 5 0 8 0 12 0 14 0 19 0 20 0 */
#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...