답안 #154279

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
154279 2019-09-20T05:04:44 Z denmircea Baloni (COCI15_baloni) C++14
100 / 100
402 ms 636 KB
#include <iostream>
#include <unordered_map>
using namespace std;
int i,n,ok,x,nr,d,y,j,k,v[1001];
short fr[200][30];
int sum[200];
unordered_map <int, int> m;
int main(){
    cin>>n;
    for(i=1;i<=n;i++){
        cin>>x;
        if(m[x+1]==0){
            nr++;
            m[x]++;
        } else {
            m[x+1]--;
            m[x]++;
        }
    }
    cout<<nr;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 4 ms 376 KB Output is correct
5 Correct 394 ms 636 KB Output is correct
6 Correct 386 ms 376 KB Output is correct
7 Correct 329 ms 376 KB Output is correct
8 Correct 312 ms 504 KB Output is correct
9 Correct 402 ms 376 KB Output is correct
10 Correct 343 ms 376 KB Output is correct