Submission #968352

# Submission time Handle Problem Language Result Execution time Memory
968352 2024-04-23T10:33:18 Z vjudge1 Vudu (COCI15_vudu) C++17
42 / 140
1000 ms 17748 KB
#include <bits/stdc++.h>
 
using namespace std;
#define ll long long
 
long long qs[1000001];
 
int main()
{
    cin.tie(0)->sync_with_stdio(false);
    cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1;i <= n;i++) {
        cin >> qs[i];
        qs[i]+=qs[i-1];
    }
    int p;
    cin >> p;
    ll cnt=0;
    for (int i=1;i<=n;i++) {
        for (int j=i;j<=n;j++) {
            if ((qs[j]-qs[i-1])/(j-i+1) >= p) {
                cnt++;
            }
        }
    }
    cout << cnt;
}
# Verdict Execution time Memory Grader output
1 Correct 182 ms 532 KB Output is correct
2 Correct 102 ms 520 KB Output is correct
3 Correct 94 ms 504 KB Output is correct
4 Execution timed out 1034 ms 17232 KB Time limit exceeded
5 Execution timed out 1044 ms 9812 KB Time limit exceeded
6 Execution timed out 1036 ms 15392 KB Time limit exceeded
7 Execution timed out 1020 ms 15972 KB Time limit exceeded
8 Execution timed out 1038 ms 14160 KB Time limit exceeded
9 Execution timed out 1050 ms 17748 KB Time limit exceeded
10 Execution timed out 1059 ms 15596 KB Time limit exceeded