Submission #24470

#TimeUsernameProblemLanguageResultExecution timeMemory
24470toonewbieNizin (COCI16_nizin)C++14
100 / 100
213 ms11664 KiB
#include <bits/stdc++.h> #define intt long long using namespace std; intt minop(intt arr[], intt n) { intt ans = 0; for (int i=0,j=n-1; i<=j;) { if (arr[i] == arr[j]) { i++; j--; } else if (arr[i] > arr[j]) { j--; arr[j] += arr[j+1] ; ans++; } else { i++; arr[i] += arr[i-1]; ans++; } } return ans; } intt arr[1234567]; int main() { intt n; cin>>n; for(intt i=0;i<n;i++)cin>>arr[i]; cout<<minop(arr,n)<<endl; 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...
#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...