Submission #581684

# Submission time Handle Problem Language Result Execution time Memory
581684 2022-06-23T03:41:43 Z elpro123 Global Warming (CEOI18_glo) C++14
10 / 100
109 ms 1752 KB
#include <bits/stdc++.h>

#define pb push_back
#define sz(x) ((int)((x).size()))
#define all(x) (x).begin(), (x).end()
 
using namespace std;

typedef vector<int> vi;

const int N=2e5+10;
int n, x, t[N];
 
int main(){
    cin>>n>>x;
    for(int i=0; i<n; i++){
        cin>>t[i];
    }
    assert(x==0);
 
    vi lis;
    for(int i=0; i<n; i++){
        int in=lower_bound(all(lis), t[i])-lis.begin();
        if(in==sz(lis)){
            lis.pb(t[i]);
        }else {
            lis[in]=t[i];
        }
    
    } 
    cout<<sz(lis)<<"\n";
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 88 ms 1068 KB Output is correct
2 Correct 87 ms 1064 KB Output is correct
3 Correct 109 ms 1008 KB Output is correct
4 Correct 87 ms 1052 KB Output is correct
5 Correct 63 ms 1752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 26 ms 864 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 40 ms 1176 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -