jakaria_hossain

codeforce - stripe

Jun 24th, 2019
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. cin>>n;
  7. int ara[n+1],cnt=0;
  8. for(int i=0;i<n;i++)
  9. {
  10. cin>>ara[i];
  11. if(i>0)ara[i]+=ara[i-1];
  12. }
  13. for(int i=0;i<n-1;i++)
  14. if(ara[i]==ara[n-1]-ara[i])cnt++;
  15. cout<<cnt<<endl;
  16. }
RAW Paste Data