• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 195,  comments - 30,  trackbacks - 0
            Status In/Out TIME Limit MEMORY Limit Submit Times Solved Users JUDGE TYPE
            stdin/stdout 3s 40960K 1071 235 Standard
            In a interger sequence S there are N(N < 1000000) intergers, there is a initial number I(-2^31 < I <2^31), which is the minimun interger in S, and no two integers are the same. Now can you find the first lost interger L make the sequence is not consecutive. For example, S = { 1, -2, 2, 9, -1 }, then I = -2, and L = 0.

            Input

            For each case N is in the first line, and next N lines is the sequence S.

            Output

            Output L for each case in a single line.

            Sample Input

            5
            1
            -2
            2
            9
            -1
            

            Sample Output

            0
            不用走入排序的誤區(qū),
            可以在線性的時間內(nèi)完成。
            先一趟循環(huán),保存輸入的值n[MAX],同時可找出最小的值,
            再來一趟循環(huán)以此為基準(zhǔn)對每個數(shù)進行標(biāo)記,對每個出現(xiàn)的num,mark[num-min]=1;
            然后
            for(int i=0;;i++)
            {if(mark[i]==0)
            cout<<i+min;
            break;
            }
            ----
            posted on 2009-07-19 14:18 luis 閱讀(348) 評論(1)  編輯 收藏 引用 所屬分類: 粗心題

            FeedBack:
            # re: joj 2199 the lost number 好題 值得做做
            2009-07-19 16:42 | crazy_coder
            好方法,這題我開始時1.26s過的,汗。。。  回復(fù)  更多評論
              
            <2011年2月>
            303112345
            6789101112
            13141516171819
            20212223242526
            272812345
            6789101112

            常用鏈接

            留言簿(3)

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            友情鏈接

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            国产精品18久久久久久vr| 国产精品午夜久久| 久久久无码精品午夜| 国产高潮国产高潮久久久91| 久久99国产精品99久久| 久久96国产精品久久久| 狠狠色丁香婷婷综合久久来来去| 91精品国产91热久久久久福利 | 久久嫩草影院免费看夜色| 久久有码中文字幕| 国产精品成人久久久| 久久亚洲精品国产精品| 91精品国产综合久久香蕉| 中文字幕久久精品 | 色诱久久av| 人妻无码久久一区二区三区免费| 蜜桃麻豆www久久| 日韩AV毛片精品久久久| av无码久久久久不卡免费网站 | 欧美噜噜久久久XXX| 久久亚洲欧美日本精品| 伊人久久大香线蕉av一区| 国产AV影片久久久久久| 亚洲欧美成人综合久久久| 久久99国产一区二区三区| 久久天天躁狠狠躁夜夜96流白浆| 久久精品无码免费不卡| 精品久久久久久中文字幕| 欧美伊人久久大香线蕉综合| 国产真实乱对白精彩久久| 久久久噜噜噜久久熟女AA片| 久久国产AVJUST麻豆| 久久99久久成人免费播放| 国产精品岛国久久久久| 久久久久久久久无码精品亚洲日韩| 久久强奷乱码老熟女网站| 日本免费一区二区久久人人澡| 久久婷婷五月综合色奶水99啪| 精品一二三区久久aaa片| 免费一级欧美大片久久网| 国产AV影片久久久久久 |