제출 #1171585

#제출 시각아이디문제언어결과실행 시간메모리
1171585NomioBaloni (COCI15_baloni)C++20
100 / 100
220 ms4032 KiB
#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	multiset<int> s;
	for(int i = 0; i < n; i++) {
		if(s.count(a[i] + 1)) s.erase(s.find(a[i] + 1));
		s.insert(a[i]);
	}
	cout << s.size() << '\n';
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...