Submission #723763

#TimeUsernameProblemLanguageResultExecution timeMemory
723763rshohruhHacker (BOI15_hac)C++14
40 / 100
1093 ms1516 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; const int inf = 1e9; int main() { #ifdef __local__ freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n; cin >> n; vector<int> lis(n); for (int i = 0; i < n; i++) { cin >> lis[i]; } vector<int> sussies(n, inf); int k = (n + 1) / 2; lis.insert(lis.end(), lis.begin(), lis.end()); for (int i = 0; i < n; i++) { int cur = 0; for (int j = 0; j < k; j++) cur += lis[i+j]; for (int j = 0; j < k; j++) sussies[(i+j)%n] = min(cur, sussies[(i+j)%n]); } cout << *max_element(sussies.begin(), sussies.end()); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...