Submission #243083

#TimeUsernameProblemLanguageResultExecution timeMemory
243083bananamathsNizin (COCI16_nizin)C++14
0 / 100
217 ms6268 KiB
#include<bits/stdc++.h> using namespace std; int main() { int N; cin>>N; int V[N]; for(int i = 0;i<N;i++) cin>>V[i]; int i = 0; int l = N-1; int somma1 = V[0]; int somma2 = V[N-1]; int conta = 0; while(i<=l) { if(somma1>somma2) { conta++; somma2+=V[l-1]; l--; } else if(somma2 > somma1) { conta++; somma1+=V[i+1]; i++; } else { i++; l--; somma1 = V[i]; somma2 = V[l]; } } cout<<conta; }
#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...