답안 #87386

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
87386 2018-11-30T16:08:13 Z MohamedAhmed0 Vudu (COCI15_vudu) C++14
42 / 140
1000 ms 64812 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n ;
    cin>>n ;
    long long arr[n] ;
    for(int i = 0 ; i < n ; ++i)
        cin>>arr[i] ;
    long long p ;
    cin>>p ;
    long long ans = 0 ;
    for(int i = 0 ; i < n ; ++i)
    {
        long long sum = 0 ;
        for(int j = i ; j < n ; ++j)
        {
            sum += arr[j] ;
            ans += (sum / (j-i+1) >= p) ;
        }
    }
    return cout<<ans , 0 ;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 442 ms 548 KB Output is correct
2 Correct 229 ms 656 KB Output is correct
3 Correct 252 ms 676 KB Output is correct
4 Execution timed out 1070 ms 17652 KB Time limit exceeded
5 Execution timed out 1070 ms 19704 KB Time limit exceeded
6 Execution timed out 1075 ms 30428 KB Time limit exceeded
7 Execution timed out 1072 ms 39420 KB Time limit exceeded
8 Execution timed out 1075 ms 45984 KB Time limit exceeded
9 Execution timed out 1008 ms 57460 KB Time limit exceeded
10 Execution timed out 1078 ms 64812 KB Time limit exceeded