QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#142318 | #1371. Missing Number | Khaled_Ramadan# | WA | 1ms | 3456kb | C++20 | 920b | 2023-08-18 23:01:17 | 2023-08-18 23:01:19 |
Judging History
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();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3456kb
input:
2 1
output:
result:
wrong answer 1st lines differ - expected: '2', found: ''