Submission #967735

# Submission time Handle Problem Language Result Execution time Memory
967735 2024-04-22T17:35:35 Z vjudge1 Vudu (COCI15_vudu) C++17
42 / 140
1000 ms 13172 KB
#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;
}
# Verdict Execution time Memory 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