mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-28 18:41:38 +08:00
23 lines
785 B
HTML
23 lines
785 B
HTML
<!DOCTYPE html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<h1>1144. The Missing Number (20)</h1>
|
|
<div id="problemContent">
|
|
<p>Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.
|
|
</p>
|
|
<p><b>
|
|
Input Specification:
|
|
</b></p>
|
|
<p>Each input file contains one test case. For each case, the first line gives a positive integer N (<= 10<sup>5</sup>). Then N integers are given in the next line, separated by spaces. All the numbers are in the range of <b>int</b>.
|
|
</p>
|
|
<p><b>
|
|
Output Specification:
|
|
</b></p>
|
|
<p>Print in a line the smallest positive integer that is missing from the input list.</p>
|
|
<b>Sample Input:</b><pre>
|
|
10
|
|
5 -25 9 6 1 3 4 2 5 17
|
|
</pre>
|
|
<b>Sample Output:</b><pre>
|
|
7
|
|
</pre>
|
|
</div> |