Submission #510074

#TimeUsernameProblemLanguageResultExecution timeMemory
510074M_sawas_Nizin (COCI16_nizin)C++17
0 / 100
164 ms7956 KiB
#include <bits/stdc++.h> #define ll long long #define endl "\n" using namespace std; ll n,a[1000007],ans; int main() { cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } for(int i=0;i<n;i++){ if(a[i]!=a[n-i-1]){ if(a[i]+a[i+1]==a[n-i-1]){ i++; ans++; } else if(a[i]+a[i+1]==a[n-i-1]+a[n-i-2]){ i++; 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...