Submission #254244

#TimeUsernameProblemLanguageResultExecution timeMemory
254244AaronNaiduRobots (IOI13_robots)C++14
39 / 100
3085 ms15356 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[]) { sort(X, X+A); reverse(X, X+A); sort(Y, Y+B); reverse(Y, Y+B); for (int i = 0; i < T; i++) { if (W[i] >= X[0] and S[i] >= Y[0]) { return -1; } } float maxMinutes = 0; for (int i = 0; i <= A; i++) { for (int j = 0; j <= B; j++) { if (i == 0 and j == 0) { continue; } float toyCount = 0; for (int k = 0; k < T; k++) { if ((i == A or W[k] >= X[i]) and (j == B or S[k] >= Y[j])) { toyCount += 1; } } float robotCount = i + j; maxMinutes = max(maxMinutes, toyCount/robotCount); } } maxMinutes = ceil(maxMinutes); return int(maxMinutes); }
#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...