# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1184950 | InvMOD | Baloni (COCI15_baloni) | C++17 | 107 ms | 3892 KiB |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int mp[N];
int main(){
int n; cin >> n;
vector<int> a(n, 0);
for(int i = 0; i < n; i++){
cin >> a[i];
}
int cnt = 0;
for(int i = 0; i < n; i++){
if(!mp[a[i]]){
mp[a[i] - 1]++;
cnt++;
}
else{
mp[a[i]]--;
mp[a[i] - 1]++;
}
}
cout << cnt << "\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |