# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
680979 | sudheerays123 | Vudu (COCI15_vudu) | C++17 | 1064 ms | 17728 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<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define ld long double
const ll N = 100+5 , INF = 1e18 , MOD = 1e9+7;
void solve(){
ll n;
cin >> n;
vector<ll> a(n+5);
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;
for(ll j = i; j <= n; j++){
sum += a[j];
ld avg = ((ld)sum/(ld)(j-i+1));
if(avg >= p) ans++;
}
}
cout << ans;
}
int main(){
fast;
ll tc = 1;
// cin >> tc;
while(tc--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |