Submission #592601

#TimeUsernameProblemLanguageResultExecution timeMemory
592601promaRobots (IOI13_robots)C++17
0 / 100
0 ms256 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; int a[50005]; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { sort(W, W + T); sort(X, X + A); if (W[T-1] > X[A-1]) return -1; int l = 0; for (int i = 0; i < T; i ++) { if (W[i] < X[l]) a[l] ++; else a[++ l] ++; } int days = 0, rem = 1; for (int i = l; i >= 0; i --) { a[i] -= days; days += max(0, a[i] / rem); a[i] -= a[i] / rem * rem; if (a[i] > 0) days ++; if (i) a[i-1] -= a[i]; } return days; }
#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...