Problem:http://codeforces.com/problemset/problem/709/A
#include<bits/stdc++.h> using namespace std; int main() { long long n,b,d,m,i,sum,ans; while(cin>>n>>b>>d) { sum=0; ans=0; for(i=0;i<n;i++) { cin>>m; if(m<=b) sum+=m; if(sum>d) { ans++; sum-=sum; } } cout<<ans<<endl; } return 0; }
No comments:
Post a Comment