Submission #1048660

#TimeUsernameProblemLanguageResultExecution timeMemory
1048660AndreasKRice Hub (IOI11_ricehub)C++14
42 / 100
1099 ms732 KiB
#include <bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) { int mx=0; for (int c=1;c<=L;c++){ vector <int> a; for (int r=0;r<R;r++) a.push_back(abs(X[r]-c)); sort(a.begin(),a.end()); int ttl=0; int b=B; for (int r=0;r<R;r++){ if (a[r]<=b){ b-=a[r]; ttl++; } } mx=max(mx,ttl); } return mx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...