답안 #959182

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
959182 2024-04-07T15:08:32 Z Ariadna Vudu (COCI15_vudu) C++14
42 / 140
1000 ms 13940 KB
#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