QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#394661#1371. Missing NumberMahmoudBassemWA 1ms3816kbC++14861b2024-04-20 17:20:362024-04-20 17:20:37

Judging History

你现在查看的是最新测评结果

  • [2024-04-20 17:20:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3816kb
  • [2024-04-20 17:20:36]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

//#define int long long
#define ld long double
#define el '\n'
#define fi first
#define se second

#define Nine_seconds ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);


void run_case(int tc) {
    int n;
    string s;

    cin >> n >> s;
    int lst = 0;
    for (int i = 0; i < s.size(); i++) {
        if (i < 9 && s[i] - '0' != lst + 1)
            return cout << lst + 1, void();
        else if (i >= 9) {
            int num = (s[i] - '0') * 10 + (s[i + 1] - '0');
            if (num != lst + 1)
                return cout << lst + 1, void();
        }
        lst++;
    }
}


int32_t main() {
    Nine_seconds        /*Turn Off for Interactive Problems*/

    int _t = 1;
    //cin >> _t;
    for (int i = 1; i <= _t; i++) {
        run_case(i);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3816kb

input:

2
1

output:


result:

wrong answer 1st lines differ - expected: '2', found: ''