Submission #109861

#TimeUsernameProblemLanguageResultExecution timeMemory
109861mohammadRice Hub (IOI11_ricehub)C++14
17 / 100
1077 ms768 KiB
#include "ricehub.h" #include "iostream" #include "vector" #include "map" #include "math.h" #include "string" #include "algorithm" #include "set" #include <iterator> #include <string.h> #include <queue> #include <list> using namespace std; typedef long long ll ; const ll M = 1e9 + 7 ; const ll oo = 1e13 ; int besthub(int R, int L, int X[], long long B){ int best = 0 ; for(int i = 1 ; i < L ; ++i){ int a[10010]; for(int j = 0 ; j < R ; ++j){ a[j] = abs(i - X[j]); } sort(a , a + R); int b = B , co = 0; while(b){ if(b > a[co]){ b -= a[co]; }else{ best = max(best , co); break; } co++; } } return best; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...