Submission #963316

#TimeUsernameProblemLanguageResultExecution timeMemory
963316SuPythonyRice Hub (IOI11_ricehub)C++17
0 / 100
1098 ms1172 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; int besthub(int R, int L, int X[], long long B) { int ans=0; for (int i=0; i<R; i++) { for (int j=i; j<R; j++) { int pos=(i+j)/2; vector<ll> c; for (int k=0; k<R; k++) { c.push_back(abs(pos-X[k])); } sort(c.begin(),c.end()); ll used=0; int a=0; for (ll i: c) { if (used+i<=B) { used+=i; a++; } else break; } ans=max(ans,a); } } 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...