<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

        CodeforcesRound#275(Div.2)ACountexample_html/css

        來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 15:56:56
        文檔

        CodeforcesRound#275(Div.2)ACountexample_html/css

        CodeforcesRound#275(Div.2)ACountexample_html/css_WEB-ITnose:題目鏈接:Counterexample Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your f
        推薦度:
        導(dǎo)讀CodeforcesRound#275(Div.2)ACountexample_html/css_WEB-ITnose:題目鏈接:Counterexample Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your f

        題目鏈接:Counterexample



        Counterexample

        time limit per test

        1 second

        memory limit per test

        256 megabytes

        input

        standard input

        output

        standard output

        Your friend has recently learned about coprime numbers. A pair of numbers {a,?b} is called coprime if the maximum number that divides both a and b is equal to one.

        Your friend often comes up with different statements. He has recently supposed that if the pair (a,?b) is coprime and the pair (b,?c) is coprime, then the pair (a,?c) is coprime.

        You want to find a counterexample for your friend's statement. Therefore, your task is to find three distinct numbers (a,?b,?c), for which the statement is false, and the numbers meet the condition l?≤?a?

        More specifically, you need to find three numbers (a,?b,?c), such that l?≤?a?

        Input

        The single line contains two positive space-separated integers l, r (1?≤?l?≤?r?≤?1018; r?-?l?≤?50).

        Output

        Print three positive space-separated integers a, b, c ? three distinct numbers (a,?b,?c) that form the counterexample. If there are several solutions, you are allowed to print any of them. The numbers must be printed in ascending order.

        If the counterexample does not exist, print the single number -1.

        Sample test(s)

        input

        2 4

        output

        2 3 4

        input

        10 11

        output

        -1

        input

        900000000000000009 900000000000000029

        output

        900000000000000009 900000000000000010 900000000000000021

        Note

        In the first sample pair (2,?4) is not coprime and pairs (2,?3) and (3,?4) are.

        In the second sample you cannot form a group of three distinct integers, so the answer is -1.

        In the third sample it is easy to see that numbers 900000000000000009 and 900000000000000021 are divisible by three.






        大致題意:給定l和r,找出滿足條件 l?≤?a?


        解題思路:暴力枚舉。枚舉所有的情況,對(duì)每個(gè)情況進(jìn)行判斷。這種做法的前提是數(shù)據(jù)不大,數(shù)據(jù)要是大了,就不能這么直接暴力了。





        AC代碼:

        #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x7fffffff#define LL long longLL gcd(LL a, LL b){ if(!b) return a; return gcd(b, a%b);}int main(){ #ifdef sxk freopen("in.txt","r",stdin); #endif LL l,r,a,b,c; while(scanf("%lld%lld",&l,&r)!=EOF) { int flag = 0; for(LL i=l; i<=r; i++){ for(LL j=i+1; j<=r; j++){ for(LL k=j+1; k<=r; k++){ if(gcd(i, j)==1 && gcd(j, k)==1 && gcd(i, k)!=1) { printf("%lld %lld %lld\n", i, j, k); flag = 1; break; } } if(flag) break; } if(flag) break; } if(!flag) printf("%d\n", -1); } return 0;}

        聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        CodeforcesRound#275(Div.2)ACountexample_html/css

        CodeforcesRound#275(Div.2)ACountexample_html/css_WEB-ITnose:題目鏈接:Counterexample Counterexample time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your f
        推薦度:
        標(biāo)簽: css example div2
        • 熱門焦點(diǎn)

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 免费观看一级毛片| 免费福利网站在线观看| 未满十八18禁止免费无码网站 | 亚洲成a人片在线观看久| www.亚洲一区| 亚洲大尺度无码无码专区| 久久精品国产亚洲av日韩| 色天使亚洲综合在线观看| 深夜福利在线免费观看| 中文字幕在线免费播放| 亚洲精品在线免费观看| 日韩中文字幕在线免费观看| 在线A亚洲老鸭窝天堂| 亚洲色av性色在线观无码| 亚洲精品国产摄像头| 久久久久久av无码免费看大片| 最近中文字幕大全免费版在线| 成年人网站免费视频| 国产精品久久香蕉免费播放| 亚洲欧洲日产国码av系列天堂| 亚洲精品国产福利在线观看| 亚洲av无码专区亚洲av不卡| 国产一级一毛免费黄片| 国产卡二卡三卡四卡免费网址| 免费精品国产自产拍观看| 亚洲AV无码码潮喷在线观看| 亚洲免费在线视频播放| 日本在线观看免费高清| 1000部啪啪毛片免费看| 亚洲A∨午夜成人片精品网站 | 免费不卡中文字幕在线| 久久精品亚洲综合一品| 亚洲AV性色在线观看| 日本免费在线观看| 在线a人片天堂免费观看高清| 国产亚洲成av片在线观看| 狠狠色伊人亚洲综合网站色| 中文字幕免费观看视频| 成人无码区免费视频观看 | 日韩免费无砖专区2020狼| 亚洲国产精品国自产电影|