답안 #90830

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
90830 2018-12-24T17:36:26 Z MohamedAhmed0 Vudu (COCI15_vudu) C++14
42 / 140
1000 ms 54028 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 , sum = 0;
    vector<int>v ;
    v.push_back(sum);
    for(int i = 0 ; i < n ; ++i)
    {
        sum += (arr[i] - p) ;
        for(int j = 0 ; j < v.size() ; ++j)
        {
            if(v[j] <= sum)
                ans++;
        }
        v.push_back(sum);
    }
    return cout<<ans , 0 ;
}

Compilation message

vudu.cpp: In function 'int main()':
vudu.cpp:20:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j = 0 ; j < v.size() ; ++j)
                         ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 504 KB Output is correct
2 Correct 18 ms 660 KB Output is correct
3 Correct 16 ms 660 KB Output is correct
4 Execution timed out 1091 ms 17848 KB Time limit exceeded
5 Execution timed out 1084 ms 19960 KB Time limit exceeded
6 Execution timed out 1090 ms 24708 KB Time limit exceeded
7 Execution timed out 1082 ms 33216 KB Time limit exceeded
8 Execution timed out 1074 ms 39732 KB Time limit exceeded
9 Execution timed out 1083 ms 50996 KB Time limit exceeded
10 Execution timed out 1087 ms 54028 KB Time limit exceeded