QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142275#1371. Missing NumberAnwar_Gehad_Maghraby#RE 0ms0kbC++23520b2023-08-18 21:22:042023-08-18 21:22:06

Judging History

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

  • [2023-08-18 21:22:06]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-08-18 21:22:04]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll  ;

const int N = 1e5 + 10;

int main() {
    cin.tie(0);cin.sync_with_stdio(0);
    cout.tie(0);cout.sync_with_stdio(0);
    int n; cin >> n;
    string s; cin >> s;
    for (int i = 0, j = 1; j <= n; ++j) {
        int x = j, sz = 0;
        while (x) {
            x /= 10;
            sz++;
        }
        if (stoi(s.substr(i, sz)) != j) {
            cout << j;
            return 0;
        }
        i += sz;
    }
}

详细

Test #1:

score: 0
Dangerous Syscalls

input:

2
1

output:


result: