Submission #6460268
Source Code Expand
Copy
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
if(a<b)return b;
else return a;
}
ll lmin(ll a,ll b){
if(a<b)return a;
else return b;
}
int main(){
int n;cin>>n;
ll a[n];rep(i,0,n)cin>>a[i];
set<ll> st;
int ans=0;
rep(i,0,n){
if(*st.begin()>=a[i]){
ans++;
st.insert(a[i]);
continue;
}
auto itr=st.lower_bound(a[i]);
itr--;
st.erase(itr);
st.insert(a[i]);
}
cout<<ans<<endl;
}
Submission Info
Submission Time |
|
Task |
E - Sequence Decomposing |
User |
ttttan |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1077 Byte |
Status |
RE |
Exec Time |
172 ms |
Memory |
1024 KB |
Judge Result
Set Name |
All |
Sample |
Score / Max Score |
0 / 500 |
0 / 0 |
Status |
|
|
Set Name |
Test Cases |
All |
all_same, killer_01, killer_02, killer_03, killer_04, killer_05, many_dup_01, many_dup_02, many_dup_03, many_dup_04, many_dup_05, many_dup_06, many_dup_07, many_dup_08, many_dup_09, many_dup_10, many_dup_11, many_dup_12, rand_max_01, rand_max_02, rand_max_03, rand_max_04, rand_max_05, rand_max_06, rand_max_07, rand_max_08, rand_max_09, rand_max_10, rand_max_11, sample_01, sample_02, sorted_ascending, sorted_descending, unique_perm_01, unique_perm_02 |
Sample |
sample_01, sample_02 |
Case Name |
Status |
Exec Time |
Memory |
all_same |
RE |
172 ms |
1024 KB |
killer_01 |
RE |
137 ms |
1024 KB |
killer_02 |
RE |
139 ms |
1024 KB |
killer_03 |
RE |
142 ms |
1024 KB |
killer_04 |
RE |
136 ms |
1024 KB |
killer_05 |
RE |
137 ms |
1024 KB |
many_dup_01 |
RE |
135 ms |
1024 KB |
many_dup_02 |
RE |
135 ms |
1024 KB |
many_dup_03 |
RE |
135 ms |
1024 KB |
many_dup_04 |
RE |
136 ms |
1024 KB |
many_dup_05 |
RE |
137 ms |
1024 KB |
many_dup_06 |
RE |
133 ms |
896 KB |
many_dup_07 |
RE |
136 ms |
1024 KB |
many_dup_08 |
RE |
136 ms |
1024 KB |
many_dup_09 |
RE |
133 ms |
896 KB |
many_dup_10 |
RE |
138 ms |
1024 KB |
many_dup_11 |
RE |
137 ms |
1024 KB |
many_dup_12 |
RE |
140 ms |
896 KB |
rand_max_01 |
RE |
142 ms |
1024 KB |
rand_max_02 |
RE |
134 ms |
896 KB |
rand_max_03 |
RE |
135 ms |
896 KB |
rand_max_04 |
RE |
139 ms |
896 KB |
rand_max_05 |
RE |
136 ms |
896 KB |
rand_max_06 |
RE |
138 ms |
896 KB |
rand_max_07 |
RE |
135 ms |
1024 KB |
rand_max_08 |
RE |
135 ms |
1024 KB |
rand_max_09 |
RE |
134 ms |
896 KB |
rand_max_10 |
RE |
136 ms |
1024 KB |
rand_max_11 |
RE |
139 ms |
896 KB |
sample_01 |
RE |
98 ms |
256 KB |
sample_02 |
AC |
1 ms |
256 KB |
sorted_ascending |
AC |
32 ms |
1024 KB |
sorted_descending |
RE |
125 ms |
1024 KB |
unique_perm_01 |
RE |
128 ms |
1024 KB |
unique_perm_02 |
RE |
123 ms |
1024 KB |