• <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 閱讀(183) 評論(0)  編輯 收藏 引用 所屬分類: 題目分類:數據結構
            久久久无码精品亚洲日韩京东传媒| 亚洲成人精品久久| 久久久久18| 亚洲精品久久久www| 亚洲国产精品无码久久久不卡| 日产精品久久久久久久性色| 精品久久久久久久无码| 久久久久久国产精品免费免费| 久久久久久久精品成人热色戒| 久久亚洲私人国产精品vA | 久久99国产一区二区三区| 91久久成人免费| 久久精品国产清自在天天线| 91久久婷婷国产综合精品青草| 欧美国产精品久久高清| 无码人妻少妇久久中文字幕蜜桃 | 久久狠狠色狠狠色综合| 精品无码人妻久久久久久| 亚洲午夜久久久久久噜噜噜| 久久99国产精品成人欧美| 久久国产精品99国产精| 伊人久久大香线蕉综合5g| 国产精品久久久久9999高清| 欧美亚洲国产精品久久| 大香网伊人久久综合网2020| 久久国语露脸国产精品电影| 成人国内精品久久久久影院VR| 久久久久久综合一区中文字幕| 久久亚洲国产精品123区| 色诱久久久久综合网ywww| 婷婷久久综合九色综合绿巨人| 久久国产精品波多野结衣AV | 久久久久久毛片免费看| 久久久久99精品成人片直播| 四虎国产精品成人免费久久| 久久人人爽人人精品视频| 99久久亚洲综合精品网站| 久久青草国产手机看片福利盒子| 国产亚洲欧美精品久久久| 亚洲国产精品成人久久| 久久人人妻人人爽人人爽|