英語翻譯
英語翻譯
Description« acmnew » is a system which allows to create programming tasks in a simple and professional way.When you add a test to the problem,the corresponding form asks you for the test index.As in most cases it is clear which index the next test will have,the system suggests the default value of the index.It is calculated as the smallest positive integer which is not used as an index for some previously added test.You are to implement this feature.Create a program which determines the default index of the next test,given the indexes of the previously added tests.
Input
The first line contains one integer n (1 ≤ n ≤ 100000) — the amount of previously added tests.The second line contains n distinct integers a1, a2, ..., an (1 ≤ ai ≤ 100000) — indexes of these tests.
Output
Output the required default value for the next test index.
Sample Input
31 7 2
Sample Output
3HINT
Description« acmnew » is a system which allows to create programming tasks in a simple and professional way.When you add a test to the problem,the corresponding form asks you for the test index.As in most cases it is clear which index the next test will have,the system suggests the default value of the index.It is calculated as the smallest positive integer which is not used as an index for some previously added test.You are to implement this feature.Create a program which determines the default index of the next test,given the indexes of the previously added tests.
Input
The first line contains one integer n (1 ≤ n ≤ 100000) — the amount of previously added tests.The second line contains n distinct integers a1, a2, ..., an (1 ≤ ai ≤ 100000) — indexes of these tests.
Output
Output the required default value for the next test index.
Sample Input
31 7 2
Sample Output
3HINT
其他人氣:546 ℃時(shí)間:2020-09-29 17:26:40
優(yōu)質(zhì)解答
描述acmnew»是一個(gè)系統(tǒng)的«允許創(chuàng)建編程任務(wù)在一個(gè)簡單的和專業(yè)的方式.當(dāng)你添加一個(gè)測(cè)試的問題,相應(yīng)的形式問你的試驗(yàn)指標(biāo).在大多數(shù)情況下,它是明確的,指數(shù)下一個(gè)測(cè)試將有,系統(tǒng)顯示默認(rèn)值的指數(shù).它通過計(jì)算最小的正整數(shù)而不是作為一個(gè)索引對(duì)于一些先前添加的測(cè)試.你是來實(shí)現(xiàn)這個(gè)功能.創(chuàng)建一個(gè)計(jì)劃,決定默認(rèn)索引的下一次測(cè)試,考慮到先前添加的測(cè)試指標(biāo).InputThe第一行包含一個(gè)整數(shù)n(1≤n≤100000)——先前添加的測(cè)試的數(shù)量.第二行包含n個(gè)不同的整數(shù)a1,a2,……,一個(gè)(1≤≤100000 ai)——這些測(cè)試的指標(biāo).OutputOutput所需的默認(rèn)值為下一個(gè)試驗(yàn)指標(biāo).示例輸入
我來回答
類似推薦
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 危言聳聽的危怎么解釋.
- 費(fèi)叔叔有一只手表和一個(gè)鬧鐘,他發(fā)現(xiàn)鬧鐘每走一個(gè)小時(shí),他的手表會(huì)多走30秒,但鬧鐘卻比標(biāo)準(zhǔn)時(shí)間每小時(shí)慢30秒.在今天中午12點(diǎn)費(fèi)叔叔把手表和標(biāo)準(zhǔn)時(shí)間校準(zhǔn),那么明天中午12點(diǎn)時(shí),費(fèi)
- 概率論的題..已知100臺(tái)車床彼此獨(dú)立的工作.
- 初二的什么人能上初三的培優(yōu)班
- 小紅的體重比小寧重5kg,小寧的體重比小紅輕七分之一,小紅的體重是多少?
- the的發(fā)音規(guī)則 是在輔音還是在輔音字母前發(fā)“ z額” 比如the USA
- 初中語文和高中語文所教的內(nèi)容有什么不同?
猜你喜歡
- 1We are having a wonderful life and Mum FEELS naturally part of it,
- 2關(guān)于吾腰千錢的問題
- 3日本最高的山是富士山嗎?高多少米阿?
- 4急求小學(xué)五年級(jí)上語文詞語手冊(cè)第14課和第15課日積月累當(dāng)中的詞語
- 55x+6y=6,8x+9y=16
- 6高中英語語法與句型
- 7我想問一下一元一次不等式組解集表示問題,如果一個(gè)不等式組是a+2<5,a+3<10,那么在數(shù)軸上表示它的解集該如何表示?是只表示出最后解集a<3,還是把a(bǔ)<3 和a<7都標(biāo)出來?還有一個(gè)問題,x+2<x-1是一元一次方程組嗎?
- 8問一句英語是否有問題
- 9中間變量值域法
- 10急求一篇以心靈的橋梁為主題的作文,不少于500字(原創(chuàng))
- 11It is difficult for a(foreign)_to learn Chinese
- 12圓的半徑是射線,直徑是直線._.(判斷對(duì)錯(cuò))