Files
PAT/html/a1144.html
T

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 (&lt;= 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>