Submission #1003184

#TimeUsernameProblemLanguageResultExecution timeMemory
1003184vjudge1Rice Hub (IOI11_ricehub)C++17
42 / 100
1065 ms1372 KiB
/* bf sol */ #include "ricehub.h" #include <bits/stdc++.h> using namespace std; #define ins insert #define pb push_back // #define int long long int #define pii pair<int, int> #define endl '\n' #define drop(x) cout<<(x)<<endl; return; #define all(x) x.begin(),x.end() int besthub(int n, int mxL, int arr[], long long B){ int ans=0; /* her i ucun ele j tapaqki : j<i j ni goturmesek i+1 right terefden nese ekstra goture bilirik */ for(int i=0;i<n;i++){ multiset<int> lst; int cnt=0; for(int j=0;j<n;j++){ lst.ins(abs(arr[i]-arr[j])); } int sum=0; for(auto v:lst){ if(sum+v>B){ break; } sum+=v; cnt++; } ans=max(ans,cnt); } 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...