제출 #1165212

#제출 시각아이디문제언어결과실행 시간메모리
1165212HappyCapybara로봇 (IOI13_robots)C++20
39 / 100
3094 ms8788 KiB
#include "robots.h" #include<bits/stdc++.h> using namespace std; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { int res = 0; vector<int> x, y, w, s; for (int i=0; i<A; i++) x.push_back(X[i]); for (int i=0; i<B; i++) y.push_back(Y[i]); for (int i=0; i<T; i++){ w.push_back(W[i]); s.push_back(S[i]); } x.push_back(0); y.push_back(0); sort(x.begin(), x.end()); reverse(x.begin(), x.end()); sort(y.begin(), y.end()); reverse(y.begin(), y.end()); for (int i=0; i<=A; i++){ for (int j=0; j<=B; j++){ int ts = 0; for (int k=0; k<T; k++){ if (w[k] >= x[i] && s[k] >= y[j]) ts++; } if (i+j == 0){ if (ts) return -1; } else res = max(res, (int) ceil((float) ts/ (float) (i+j))); } } return res; }
#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...