QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394661 | #1371. Missing Number | MahmoudBassem | WA | 1ms | 3816kb | C++14 | 861b | 2024-04-20 17:20:36 | 2024-04-20 17:20:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define ld long double
#define el '\n'
#define fi first
#define se second
#define Nine_seconds ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
void run_case(int tc) {
int n;
string s;
cin >> n >> s;
int lst = 0;
for (int i = 0; i < s.size(); i++) {
if (i < 9 && s[i] - '0' != lst + 1)
return cout << lst + 1, void();
else if (i >= 9) {
int num = (s[i] - '0') * 10 + (s[i + 1] - '0');
if (num != lst + 1)
return cout << lst + 1, void();
}
lst++;
}
}
int32_t main() {
Nine_seconds /*Turn Off for Interactive Problems*/
int _t = 1;
//cin >> _t;
for (int i = 1; i <= _t; i++) {
run_case(i);
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3816kb
input:
2 1
output:
result:
wrong answer 1st lines differ - expected: '2', found: ''