Submission #963302

#TimeUsernameProblemLanguageResultExecution timeMemory
963302SuPythonyRice Hub (IOI11_ricehub)C++17
42 / 100
1051 ms2128 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=1; i<=L; i++) { vector<ll> c; for (int j=0; j<R; j++) { c.push_back(abs(i-X[j])); } 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...