Skip to content

Commit f555e13

Browse files
authored
Merge pull request #1664 from AlgorithmWithGod/khj20006
[20251213] BOJ / G2 / 반도체 설계 / 권혁준
2 parents ef8da4d + 21d031c commit f555e13

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```cpp
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
5+
int N;
6+
vector<int> v;
7+
8+
int main() {
9+
cin.tie(0)->sync_with_stdio(0);
10+
11+
cin>>N;
12+
for(int a;N--;) {
13+
cin>>a;
14+
int idx = lower_bound(v.begin(), v.end()) - v.begin();
15+
if(idx == v.size()) v.push_back(a);
16+
else v[idx] = a;
17+
}
18+
cout<<v.size();
19+
20+
}
21+
```

0 commit comments

Comments
 (0)