QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394632#1371. Missing NumberAl-Hassan_Mohamed#WA 1ms3788kbC++20583b2024-04-20 17:04:222024-04-20 17:04:22

Judging History

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

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

answer

#include <bits/stdc++.h>

#define sz(x)  (int)x.size()
#define bigint __int128
#define el '\n'
#define ll long long
using namespace std;

void acc() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int idx = -1;
    for (int i = 1; i <= n; i++) {
        string t = to_string(i);
        if (s.find(t) == string::npos) {
            idx = i;
            break;
        }
    }
    cout << idx << el;

}

int main() {
    cout.tie(0);
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int t = 1;
    // cin >> t;
    while (t--)acc();
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3620kb

input:

2
1

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

2
2

output:

1

result:

ok single line: '1'

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3660kb

input:

100
23456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100

output:

-1

result:

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