제출 #74101

#제출 시각아이디문제언어결과실행 시간메모리
74101charlies_mooNizin (COCI16_nizin)C++14
100 / 100
210 ms19280 KiB
#include <cstdio> #include <iostream> using namespace std; int n; int a[1000001]; int l,r; int ans; int main() { cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; l=1,r=n; while(l-1<r) { if(a[l]==a[r]) { l++,r--; continue; } if(a[l]>a[r]) { a[r-1]+=a[r]; r--; ans++; } else { a[l+1]+=a[l]; l++; ans++; } } cout<<ans; 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...