Submission #282768

# Submission time Handle Problem Language Result Execution time Memory
282768 2020-08-24T22:09:19 Z doowey Global Warming (CEOI18_glo) C++14
0 / 100
2000 ms 5236 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const ll inf = (ll)1e10;

int main(){
    fastIO;
    int n;
    ll x;
    cin >> n >> x;
    vector<ll> v(n);
    for(int i = 0 ; i < n; i ++ ){
        cin >> v[i];
    }
    ll ans = 0;
    for(int k = 0 ; k <= n; k ++ ){
        vector<ll> nw;
        for(int y = 0; y < n ; y ++ ){
            if(y < k)
                nw.push_back(v[y]);
            else
                nw.push_back(v[y]-x);
        }
        vector<ll> dp(n);
        for(int i = 0 ; i < n; i ++ ){
            dp[i]=1;
            for(int j = 0; j < i ; j ++ ){
                if(nw[i]>nw[j])
                    dp[i]=max(dp[i],dp[j]+1);
            }
            ans=max(ans,dp[i]);
        }
    }
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 5236 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2077 ms 1660 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2089 ms 2808 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -