| //https://www.acmicpc.net/problem/14646 #include <iostream> |
| using namespace std; |
| bool menu[100001]; |
| int main() |
| { |
| int n,x; |
| cin >> n; |
| int cnt=0; |
| int max=0; |
| for(int i=0; i<2*n; i++) |
| { |
| cin >> x; |
| if(menu[x]) cnt--; |
| else |
| { |
| menu[x]=true; |
| cnt++; |
| } |
| if(cnt>max) max=cnt; |
| } |
| cout << max; |
| } |
'알고리즘 문제 풀이 > 1DP_과제(~180615)' 카테고리의 다른 글
| 171224_1357_뒤집힌 덧셈 (0) | 2017.12.24 |
|---|---|
| 171223_1547_공 (0) | 2017.12.23 |
| 171221_2010_플러그 (0) | 2017.12.21 |
| 171220_3986_좋은 단어 (0) | 2017.12.20 |
| 171219_5585_거스름돈 (0) | 2017.12.19 |