QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#331209#1371. Missing Numberjhtang2#WA 0ms3716kbC++14449b2024-02-18 03:26:552024-02-18 03:26:55

Judging History

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

  • [2024-02-18 03:26:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3716kb
  • [2024-02-18 03:26:55]
  • 提交

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: ''