• <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>
            心如止水
            Je n'ai pas le temps
            posts - 400,comments - 130,trackbacks - 0
            Use a hash table to reflect two lists of numbers.
            It seems that each number cannot be less that -32768 and cannot be more that 32767.But I heard that it was not true."maxn" should be 100000,I suggest.Or you can try to find it...
            Here is my code:
            #include<iostream>
            #include
            <string.h>
            #define maxn 100000
            using namespace std;
            long n,m;
            bool a[2*maxn+7],b[2*maxn+7];
            long f(long x)
            {
                
            return x+maxn+1;
            }
            int main()
            {
                
            /*
                freopen("data.in","r",stdin);
                freopen("data.out","w",stdout);
                //
            */
                memset(a,
            false,sizeof(a));
                memset(b,
            false,sizeof(b));
                cin
            >>n;
                
            for(long i=1;i<=n;i++)
                {
                    
            long t;
                    cin
            >>t;
                    a[f(t)]
            =true;
                }
                cin
            >>m;
                
            for(long i=1;i<=n;i++)
                {
                    
            long t;
                    cin
            >>t;
                    b[f(t)]
            =true;
                }
                
            for(long i=-maxn;i<=maxn;i++)
                    
            if(a[f(i)]&&b[f(10000-i)])
                    {
                        cout
            <<"YES"<<endl;
                        
            return 0;
                    }
                cout
            <<"NO"<<endl;
            return 0;
            }


            posted on 2010-09-21 16:11 lee1r 閱讀(185) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:數據結構
            久久久免费精品re6| 久久久久九九精品影院| 久久国产亚洲精品无码| 欧美精品一区二区精品久久| 免费国产99久久久香蕉| 一本大道久久香蕉成人网| 人妻无码中文久久久久专区| 99久久夜色精品国产网站| 人妻无码精品久久亚瑟影视| 国产精品久久久久久久| 久久久久久国产精品美女| 久久99精品久久久久久秒播| 欧美熟妇另类久久久久久不卡| 久久强奷乱码老熟女网站| 久久精品国产99国产精偷| 熟妇人妻久久中文字幕| 性欧美大战久久久久久久| 91精品国产91久久久久久蜜臀 | 日韩欧美亚洲综合久久影院d3| 久久综合伊人77777| 成人精品一区二区久久久| 69SEX久久精品国产麻豆| 亚洲国产精品无码久久一线| 久久久久国产视频电影| 99久久精品免费观看国产| 久久精品无码专区免费青青 | 久久精品无码专区免费东京热 | 久久青青草视频| 亚洲国产精品成人久久蜜臀 | 久久夜色精品国产噜噜亚洲a| 国产成人99久久亚洲综合精品| 99久久中文字幕| 欧美亚洲色综久久精品国产 | 国产免费久久精品丫丫| 热久久这里只有精品| 精品久久久久久国产91| 国产精品久久99| 久久精品国产亚洲麻豆| 国产精品久久99| 久久精品成人免费国产片小草| 99久久精品免费国产大片|