#include <bits/stdc++.h>
using namespace std;
#define lesgooo ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl '\n'
#define int long long
signed main()
{
lesgooo;
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
int p;
cin >> p;
int ctr = 0;
for (int i =0; i < n; i++)
{
int sum = 0;
for (int j = i; j < n; j++)
{
sum+=a[j];
ctr+=sum/(j-i+1)>=p;
}
}
cout << ctr;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
196 ms |
388 KB |
Output is correct |
2 |
Correct |
109 ms |
364 KB |
Output is correct |
3 |
Correct |
102 ms |
364 KB |
Output is correct |
4 |
Execution timed out |
1067 ms |
17196 KB |
Time limit exceeded |
5 |
Execution timed out |
1041 ms |
9804 KB |
Time limit exceeded |
6 |
Execution timed out |
1035 ms |
15168 KB |
Time limit exceeded |
7 |
Execution timed out |
1050 ms |
15820 KB |
Time limit exceeded |
8 |
Execution timed out |
1077 ms |
13756 KB |
Time limit exceeded |
9 |
Execution timed out |
1039 ms |
17740 KB |
Time limit exceeded |
10 |
Execution timed out |
1057 ms |
15388 KB |
Time limit exceeded |