제출 #1171582

#제출 시각아이디문제언어결과실행 시간메모리
1171582NomioBaloni (COCI15_baloni)C++20
0 / 100
157 ms4088 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]; } set<int> s; for(int i = 0; i < n; i++) { if(s.count(a[i] + 1)) s.erase(a[i] + 1); s.insert(a[i]); } cout << s.size() << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...