답안 #898485

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
898485 2024-01-04T18:16:35 Z Blagoj Baloni (COCI15_baloni) C++17
0 / 100
46 ms 3916 KB
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define ll long long
#define all(x) (x).begin(), (x).end()

const int mxh = 1e6 + 10;
int cnt[mxh];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (!cnt[x]) {
            ans++;
            cnt[x]++;
        }
        cnt[x - 1]++;
    }
    cout << ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Incorrect 43 ms 3916 KB Output isn't correct
6 Incorrect 46 ms 3892 KB Output isn't correct
7 Incorrect 34 ms 3156 KB Output isn't correct
8 Incorrect 34 ms 3152 KB Output isn't correct
9 Incorrect 39 ms 3660 KB Output isn't correct
10 Incorrect 38 ms 3412 KB Output isn't correct