# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959256 | lalig777 | Vudu (COCI15_vudu) | C++14 | 1091 ms | 13908 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |