#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,k,arr[1000100], ans;
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
cin >> n;
for(int i = 1; i<=n; ++i) cin >> arr[i];
cin >> k;
for(int i = 1; i<=n; ++i){
int sum = 0;
for(int j = i; j<=n; ++j){
sum+=arr[j];
if(sum >= k*(j - i + 1)) ans++;
}
}
cout << ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
348 KB |
Output is correct |
2 |
Correct |
15 ms |
540 KB |
Output is correct |
3 |
Correct |
13 ms |
348 KB |
Output is correct |
4 |
Execution timed out |
1020 ms |
12820 KB |
Time limit exceeded |
5 |
Execution timed out |
1044 ms |
7512 KB |
Time limit exceeded |
6 |
Execution timed out |
1071 ms |
11516 KB |
Time limit exceeded |
7 |
Execution timed out |
1035 ms |
11932 KB |
Time limit exceeded |
8 |
Execution timed out |
1027 ms |
10864 KB |
Time limit exceeded |
9 |
Execution timed out |
1072 ms |
13172 KB |
Time limit exceeded |
10 |
Execution timed out |
1100 ms |
11348 KB |
Time limit exceeded |