QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#331209 | #1371. Missing Number | jhtang2# | WA | 0ms | 3716kb | C++14 | 449b | 2024-02-18 03:26:55 | 2024-02-18 03:26:55 |
Judging History
answer
// Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= 9 && i <= n; i++) {
char c;
cin >> c;
if (c - '0' != i) {
cout << i;
return 0;
}
}
for (int i = 10; i <= 99 && i <= n; i++) {
char d1, d2;
cin >> d1 >> d2;
int num = (d1 - '0') * 10 + (d2 - '0');
if (num != i) {
cout << i;
return 0;
}
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
2 1
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
2 2
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
100 23456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
output:
1
result:
ok single line: '1'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3516kb
input:
100 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
output:
result:
wrong answer 1st lines differ - expected: '100', found: ''