QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#486258#8788. Page on vdome.comucup-team3924#WA 0ms3496kbC++20596b2024-07-21 18:10:352024-07-21 18:10:35

Judging History

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

  • [2024-07-21 18:10:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3496kb
  • [2024-07-21 18:10:35]
  • 提交

answer

#include <bits/stdc++.h>

int main() {
    std::cin.tie(NULL);
    std::iostream::sync_with_stdio(false);

    int N;

    std::cin >> N;

    if (N >= 10) {
        std::cout << 10;
        return 0;
    }

    std::set<int> inside;

    int mex = 1;

    for (int i = 1; i <= N; i++) {
        int val = i;
        int rev = 0;

        while (val > 0) {
            rev = rev * 10 + val % 10;
            val /= 10;
        }

        inside.insert(rev);
    }

    while (inside.find(mex) != inside.end()) mex++;

    std::cerr << mex;

    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3496kb

input:

5

output:


result:

wrong answer Answer contains longer sequence [length = 1], but output contains 0 elements