Submission #44938782


Source Code Expand

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}

void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto&i:a) cin >> i;
    sort(begin(a), end(a));
    for (int i = 1; i < n; i++)
    {
        if(a[i-1]+1 < a[i])
        {
            cout << a[i] - 1 << endl;
            return;
        }
    }
    
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    solve();
}

Submission Info

Submission Time
Task B - MissingNo.
User Motsu_xe
Language C++ 20 (gcc 12.2)
Score 200
Code Size 684 Byte
Status AC
Exec Time 1 ms
Memory 3636 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 17
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
random_01.txt AC 1 ms 3564 KiB
random_02.txt AC 1 ms 3636 KiB
random_03.txt AC 1 ms 3508 KiB
random_04.txt AC 1 ms 3456 KiB
random_05.txt AC 1 ms 3456 KiB
random_06.txt AC 1 ms 3500 KiB
random_07.txt AC 1 ms 3560 KiB
random_08.txt AC 1 ms 3632 KiB
random_09.txt AC 1 ms 3472 KiB
random_10.txt AC 1 ms 3504 KiB
random_11.txt AC 1 ms 3416 KiB
random_12.txt AC 1 ms 3632 KiB
random_13.txt AC 1 ms 3428 KiB
random_14.txt AC 1 ms 3492 KiB
sample_01.txt AC 1 ms 3548 KiB
sample_02.txt AC 1 ms 3492 KiB
sample_03.txt AC 1 ms 3492 KiB