QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#142318#1371. Missing NumberKhaled_Ramadan#WA 1ms3456kbC++20920b2023-08-18 23:01:172023-08-18 23:01:19

Judging History

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

  • [2023-08-18 23:01:19]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3456kb
  • [2023-08-18 23:01:17]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
typedef long long ll;
const long long N = 3e5 + 7, Mod = 1e9 + 7, INF = 2e18;
ll inv(ll a, ll b = Mod) { return 1 < a ? b - inv(b % a, a) * b / a : 1; }
const int dx[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
const int dy[9] = {1, -1, 0, 0, -1, 1, 1, -1, 0};
void solve()
{
    ll n;
    cin >> n;
    string s;
    cin >> s;
    int x = 1;
    for (int i =  0; i < s.size(); x++)
    {
        string ss = "";
        ll xx = x;
        while (xx)
        {
            ss = char('0' + xx % 10) + ss;
            xx /= 10;
        }
        for (int j = 0; j < ss.size(); j++, i++)
        {
            if (s[i] == ss[j])continue;
            return void(cout << x);
        }
    }
}
int main()
{
    IO;
    int TC = 1;
    // cin >> TC;
    while (TC--)
        solve();
}

詳細信息

Test #1:

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

input:

2
1

output:


result:

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