Submission #557148

#TimeUsernameProblemLanguageResultExecution timeMemory
557148n0sk1llRice Hub (IOI11_ricehub)C++14
68 / 100
1081 ms884 KiB
#include "ricehub.h" #include<bits/stdc++.h> using namespace std; long long int typedef li; int besthub(int n, int m, int x[], li b) { int kolko=0; for (int i=0;i<n;i++) { vector<int> pom; for (int j=0;j<n;j++) pom.push_back(abs(x[i]-x[j])); sort(pom.begin(),pom.end()); li tmp=b; int sta=0; for (int j=0;j<n;j++) { if (pom[j]>tmp) break; sta++; tmp-=pom[j]; } kolko=max(kolko,sta); } return kolko; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...