답안 #42996

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
42996 2018-03-07T17:08:17 Z Mouhanad_Hafez Baloni (COCI15_baloni) C++11
0 / 100
246 ms 676 KB
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define SI size()
#define pb push_back
using namespace std;
const ll MAX=1000007;
ll i,m,n,sum,a[MAX],ans;
int main(){
    cin>>n;
    for (i=0;i<n;i++){
        ll x;
        cin>>x;
        if (a[x]==0){
            ans++;
            a[x-1]++;
        }
        else {
            a[x]--;
            a[x-1]--;

        }
    }
    cout<<ans;
}

# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Incorrect 2 ms 352 KB Output isn't correct
3 Incorrect 3 ms 424 KB Output isn't correct
4 Incorrect 3 ms 460 KB Output isn't correct
5 Incorrect 220 ms 588 KB Output isn't correct
6 Incorrect 246 ms 588 KB Output isn't correct
7 Incorrect 204 ms 588 KB Output isn't correct
8 Incorrect 173 ms 660 KB Output isn't correct
9 Incorrect 198 ms 676 KB Output isn't correct
10 Incorrect 224 ms 676 KB Output isn't correct