제출 #1283474

#제출 시각아이디문제언어결과실행 시간메모리
1283474uranhishigBaloni (COCI15_baloni)C++20
0 / 100
318 ms7576 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define all(a) (a).begin(),(a).end() #define rep(i, n) for(int i = 0; i < (n); i++) signed main(){ int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++){ cin >> a[i]; } map<int, int> mp; int ans = 0; for (int i = 0; i < n; i++) { if(mp[a[i]+1] >= 1) { mp[a[i]+1]--; } mp[a[i]]++; } rep(i, n){ if(mp[a[i]]>0){ ans++; } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...