Submission #959256

#TimeUsernameProblemLanguageResultExecution timeMemory
959256lalig777Vudu (COCI15_vudu)C++14
42 / 140
1091 ms13908 KiB
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; typedef long long int ll; int main(){ cin.tie(NULL); ios::sync_with_stdio(false); int n, p; cin>>n; vector<int>v(n); for (int i=0; i<n; i++) cin>>v[i]; cin>>p; ll ans=0; for (int i=1; i<=n; i++){ ll aim=p*i; ll sum=0; for (int j=0; j<i; j++) sum+=v[j]; if (aim<=sum) ans++; for (int j=i; j<n; j++){ sum-=v[j-i]; sum+=v[j]; if (aim<=sum) ans++; } }cout<<ans<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...