Submission #256358

#TimeUsernameProblemLanguageResultExecution timeMemory
256358SortingRobots (IOI13_robots)C++17
0 / 100
1 ms384 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; int a, b, t; int *x, *y, *w, *s; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]){ a = A, b = B, t = T, x = X, y = Y, w = W, s = S; sort(w, w + t); sort(x, x + a); vector<int> arr; int j = 0, pr = 0; for(int i = 0; i < t; ++i){ while(j < a && x[j] < w[i]){ arr.push_back(i - pr); pr = i; j++; } } while(j < a){ arr.push_back(t - pr); pr = t; j++; } int ans = 0, sum = 0; for(int i = 1; i <= a; ++i){ sum += arr[a - i]; ans = max(ans, sum / i + (bool)(sum % i)); } return ans; }
#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...