답안 #162697

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
162697 2019-11-09T11:24:05 Z Leonardo_Paes Baloni (COCI15_baloni) C++17
0 / 100
88 ms 7288 KB
#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e6+10;

bitset<maxn> mark;

int h[maxn];

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int n, ans=0;

    cin >> n;

    for(int i=1; i<=n; i++) cin >> h[i];

    for(int i=n; i>=1; i--){
        if(mark[h[i]-1]){
            mark[h[i]-1] = false;
        }
        else{
            ans++;
        }
        mark[h[i]] = true;
    }

    cout << ans << endl;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 392 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Incorrect 88 ms 7004 KB Output isn't correct
6 Incorrect 88 ms 7288 KB Output isn't correct
7 Incorrect 73 ms 6036 KB Output isn't correct
8 Incorrect 71 ms 6008 KB Output isn't correct
9 Incorrect 81 ms 6584 KB Output isn't correct
10 Incorrect 80 ms 6648 KB Output isn't correct