Submission #82136

#TimeUsernameProblemLanguageResultExecution timeMemory
82136heonNizin (COCI16_nizin)C++11
100 / 100
83 ms19432 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector <int> v(n); for(int i = 0; i < n; i++) cin >> v[i]; int sol = 0, lo = 0, hi = n-1; while(lo < hi){ if(v[lo] == v[hi]){ lo++, hi--; continue; } else if(v[lo] < v[hi]){ v[lo + 1] += v[lo]; lo++; } else{ v[hi - 1] += v[hi]; hi--; } sol++; } cout << sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...