Submission #510079

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