Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int ar[200000];
- int main() {
- int n;
- while(cin>>n) {
- multiset<int> mt;
- for(int i=1; i<=n; i++)
- scanf("%d",ar+i);
- int k=12,cnt=0;
- for(int i=1; i<=n; i++) {
- int sum=0;
- mt.insert(ar[i]);
- for(int j=1; j<=i; j++)
- sum+=ar[j];
- if(sum>k)
- cnt++;
- }
- cout<<cnt<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement