Submission #83599

#TimeUsernameProblemLanguageResultExecution timeMemory
83599Leonardo_PaesNizin (COCI16_nizin)C++11
100 / 100
77 ms8452 KiB
#include <bits/stdc++.h> using namespace std; #define MAXN 1000100 long long vet[MAXN]; int main(){ ios_base::sync_with_stdio(false);cin.tie(NULL); 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...