SHARE
TWEET

codeforce - stripe

jakaria_hossain Jun 24th, 2019 55 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top