Submission #83592

#TimeUsernameProblemLanguageResultExecution timeMemory
83592Leonardo_PaesNizin (COCI16_nizin)C++11
100 / 100
212 ms23360 KiB
#include <bits/stdc++.h> using namespace std; #define MAXN 1000100 long long vet[MAXN]; int main(){ int n; cin >> n; for(int i=1; i<=n; i++){ cin >> vet[i]; } int resp=0; int atuali=0, atualj=0; for(int i=1, j=n; i<j;){ if(vet[i]+atuali==vet[j]+atualj){ atuali=atualj=0; i++; j--; continue; } resp++; if(vet[i]+atuali<vet[j]+atualj){ atuali+=vet[i]; i++; continue; } else{ atualj+=vet[j]; j--; continue; } } cout << resp << 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...