QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#331212#1371. Missing Numberjhtang2#AC ✓0ms3704kbC++14466b2024-02-18 03:27:472024-02-18 03:27:48

Judging History

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

  • [2024-02-18 03:27:48]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3704kb
  • [2024-02-18 03:27:47]
  • 提交

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;
		}
	}

	cout << 100;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3580kb

input:

2
1

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

2
2

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

100
23456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

100
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899

output:

100

result:

ok single line: '100'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818384858687888990919293949596979899100

output:

82

result:

ok single line: '82'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586888990919293949596979899100

output:

87

result:

ok single line: '87'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798100

output:

99

result:

ok single line: '99'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100

output:

46

result:

ok single line: '46'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

100
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100

output:

52

result:

ok single line: '52'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3704kb

input:

20
12345678910111213141516181920

output:

17

result:

ok single line: '17'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

46
123456789101112131415161718192021222324252627282931323334353637383940414243444546

output:

30

result:

ok single line: '30'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

98
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777980818283848586878889909192939495969798

output:

78

result:

ok single line: '78'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

11
12345678911

output:

10

result:

ok single line: '10'