Submission #418241

#TimeUsernameProblemLanguageResultExecution timeMemory
418241temurbek_khujaevRice Hub (IOI11_ricehub)C++17
42 / 100
1097 ms332 KiB
#include "ricehub.h" #include <bits/stdc++.h> using namespace std; int besthub(int R, int L, int X[], long long B) { int ans = 0; for (int i = 0; i < R; i++) { long long b = 0; for (int j = i; j >= 0; j--) { b += X[i] - X[j]; long long t = 0; for (int k = i; k < R; k++) { t += X[k] - X[i]; if ( b + t <= B) { ans = max(ans, k - j + 1); } } } } 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...