답안 #680979

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
680979 2023-01-12T07:35:46 Z sudheerays123 Vudu (COCI15_vudu) C++17
42 / 140
1000 ms 17728 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 400 KB Output is correct
2 Correct 37 ms 440 KB Output is correct
3 Correct 32 ms 340 KB Output is correct
4 Execution timed out 1058 ms 17208 KB Time limit exceeded
5 Execution timed out 1030 ms 9804 KB Time limit exceeded
6 Execution timed out 1049 ms 15200 KB Time limit exceeded
7 Execution timed out 1064 ms 15856 KB Time limit exceeded
8 Execution timed out 1053 ms 13780 KB Time limit exceeded
9 Execution timed out 1061 ms 17728 KB Time limit exceeded
10 Execution timed out 1057 ms 15424 KB Time limit exceeded