Submission #1013259

#TimeUsernameProblemLanguageResultExecution timeMemory
1013259MuhammetRice Hub (IOI11_ricehub)C++17
0 / 100
27 ms4312 KiB
#include <bits/stdc++.h> #include "ricehub.h" #define sz(s) (int)s.size() using namespace std; #define ll long long int besthub(int n, int L, int a[], ll b){ int ind = n/2; vector <int> v; for(int i = 0; i < n; i++){ v.push_back(abs(a[i]-a[ind])); } sort(v.rbegin(), v.rend()); int ans = 0; while(sz(v) > 0){ if(v.back() > b) break; b -= v.back(); v.pop_back(); ans++; } 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...