Submission #1019591

#TimeUsernameProblemLanguageResultExecution timeMemory
1019591LuvidiRice Hub (IOI11_ricehub)C++17
68 / 100
1051 ms1252 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll, ll> #define pii pair<int, int> #define fs first #define sc second #define pb push_back int besthub(int n, int l, int X[], long long b) { ll a[n],ans=0; for(int i=0;i<n;i++)a[i]=X[i]; for(int i=0;i<n;i++){ vector<ll> v; for(int j=0;j<n;j++)v.pb(abs(a[i]-a[j])); sort(v.begin(),v.end()); ll s=0,c=0; for(int i=0;i<n;i++){ s+=v[i]; if(s>b)break; c++; } ans=max(ans,c); } 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...