답안 #959256

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
959256 2024-04-07T18:27:22 Z lalig777 Vudu (COCI15_vudu) C++14
42 / 140
1000 ms 13908 KB
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long int ll;

int main(){
    cin.tie(NULL);
    ios::sync_with_stdio(false);
    int n, p;
    cin>>n;
    vector<int>v(n);
    for (int i=0; i<n; i++) cin>>v[i];
    cin>>p;
    ll ans=0;
    for (int i=1; i<=n; i++){
        ll aim=p*i;
        ll sum=0;
        for (int j=0; j<i; j++) sum+=v[j];
        if (aim<=sum) ans++;
        for (int j=i; j<n; j++){
            sum-=v[j-i];
            sum+=v[j];
            if (aim<=sum) ans++;
        }
    }cout<<ans<<'\n';
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 348 KB Output is correct
2 Correct 28 ms 476 KB Output is correct
3 Correct 29 ms 532 KB Output is correct
4 Execution timed out 1086 ms 13552 KB Time limit exceeded
5 Execution timed out 1091 ms 7760 KB Time limit exceeded
6 Execution timed out 1056 ms 11860 KB Time limit exceeded
7 Execution timed out 1031 ms 12368 KB Time limit exceeded
8 Execution timed out 1068 ms 10884 KB Time limit exceeded
9 Execution timed out 1044 ms 13908 KB Time limit exceeded
10 Execution timed out 1090 ms 12112 KB Time limit exceeded