#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define pb push_back
#define bismillah ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0);
bool bom[200005];
int main(){
bismillah
ll n;
cin >> n;
vector<ll> a(n+1);
for (ll i = 1 ; i <= n ; i++){
cin >> a[i];
}
ll p;
cin >> p;
ll ans = 0;
for (ll i = 1; i <=n ; i++){
ll sum = 0;
ll cnt = 0;
for (ll j = i ; j <= n ; j++){
sum+=a[j];
cnt++;
if (sum >= cnt*p){
ans++;
}
}
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |