#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n;
ll p;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin >> a[i];
cin >> p;
ll sum, ans = 0;
for (int i = 0; i < n; ++i) {
sum = 0;
for (int j = i; j < n; ++j) {
sum += a[j];
if (sum >= p * (ll)(j-i+1)) ++ans;
}
}
cout << ans << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
29 ms |
596 KB |
Output is correct |
2 |
Correct |
18 ms |
348 KB |
Output is correct |
3 |
Correct |
16 ms |
344 KB |
Output is correct |
4 |
Execution timed out |
1067 ms |
13412 KB |
Time limit exceeded |
5 |
Execution timed out |
1084 ms |
7668 KB |
Time limit exceeded |
6 |
Execution timed out |
1035 ms |
11828 KB |
Time limit exceeded |
7 |
Execution timed out |
1046 ms |
12512 KB |
Time limit exceeded |
8 |
Execution timed out |
1016 ms |
10856 KB |
Time limit exceeded |
9 |
Execution timed out |
1052 ms |
13940 KB |
Time limit exceeded |
10 |
Execution timed out |
1060 ms |
12140 KB |
Time limit exceeded |