• <fieldset id="8imwq"><menu id="8imwq"></menu></fieldset>
  • <bdo id="8imwq"><input id="8imwq"></input></bdo>
    最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題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關鍵字專題關鍵字專題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
    當前位置: 首頁 - 科技 - 知識百科 - 正文

    codeforces260div2A,B,C_html/css

    來源:懂視網 責編:小采 時間:2020-11-27 15:54:33
    文檔

    codeforces260div2A,B,C_html/css

    codeforces260div2A,B,C_html/css_WEB-ITnose:A:水題,結構體排序后,看兩個數組的是否序列相同。 B:分別寫出來1,2,3,4,的n次方對5取余。你會發現和對5取余有一個循環節。如果%4 = 0,輸出4,否則輸出0. 寫一個大數取余就過了。 B. Fedya and Maths time limit per test
    推薦度:
    導讀codeforces260div2A,B,C_html/css_WEB-ITnose:A:水題,結構體排序后,看兩個數組的是否序列相同。 B:分別寫出來1,2,3,4,的n次方對5取余。你會發現和對5取余有一個循環節。如果%4 = 0,輸出4,否則輸出0. 寫一個大數取余就過了。 B. Fedya and Maths time limit per test

    A:水題,結構體排序后,看兩個數組的是否序列相同。

    B:分別寫出來1,2,3,4,的n次方對5取余。你會發現和對5取余有一個循環節。如果%4 = 0,輸出4,否則輸出0.

    寫一個大數取余就過了。

    B. Fedya and Maths

    time limit per test

    1 second

    memory limit per test

    256 megabytes

    input

    standard input

    output

    standard output

    Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:

    (1n?+?2n?+?3n?+?4n) mod 5

    for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language).

    Input

    The single line contains a single integer n (0?≤?n?≤?10105). The number doesn't contain any leading zeroes.

    Output

    Print the value of the expression without leading zeros.

    Sample test(s)

    input

    output

    input

    124356983594583453458888889

    output

    Note

    Operation x mod y means taking remainder after division x by y.

    Note to the first sample:

    #include #include #include #include #include #include #include #include #include #include #include #include #include #define eps 1e-9///#define M 1000100///#define LL __int64#define LL long long///#define INF 0x7ffffff#define INF 0x3f3f3f3f#define PI 3.1415926535898#define zero(x) ((fabs(x)>s) { int n= s.size(); int cnt = s[0]-'0'; for(int i = 1; i < n; i++) { cnt %= 4; cnt = (cnt*10+(s[i]-'0'))%4; } if(cnt%4 == 0) cout<<4<

    C:給你一些數,你取了一個數那么比這個數大1,和小1的數字就會被刪掉。問你最大能取到的數的和。

    先根據數字進行哈希,然后線性的dp一遍,dp[i][1] = ma(dp[i-2][0], dp[i-2][1]) + vis[i]*i,dp[i][0] = max(dp[i-1][0], dp[i-1][1]).1代表取這個數,0代表不取。注意數據類型要用long long。

    C. Boredom

    time limit per test

    1 second

    memory limit per test

    256 megabytes

    input

    standard input

    output

    standard output

    Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.

    Given a sequence a consisting of n integers. The player can make several steps. In a single step he can choose an element of the sequence (let's denote it ak) and delete it, at that all elements equal to ak?+?1 and ak?-?1 also must be deleted from the sequence. That step brings ak points to the player.

    Alex is a perfectionist, so he decided to get as many points as possible. Help him.

    Input

    The first line contains integer n (1?≤?n?≤?105) that shows how many numbers are in Alex's sequence.

    The second line contains n integers a1, a2, ..., an (1?≤?ai?≤?105).

    Output

    Print a single integer ? the maximum number of points that Alex can earn.

    Sample test(s)

    input

    21 2

    output

    input

    31 2 3

    output

    input

    91 2 1 3 2 2 2 2 3

    output

    10

    Note

    Consider the third test example. At first step we need to choose any element equal to 2. After that step our sequence looks like this [2,?2,?2,?2]. Then we do 4 steps, on each step we choose any element equals to 2. In total we earn 10 points.


    #include #include #include #include #include #include #include #include #include #include #include #include #include #define eps 1e-9///#define M 1000100///#define LL __int64#define LL long long///#define INF 0x7ffffff#define INF 0x3f3f3f3f#define PI 3.1415926535898#define zero(x) ((fabs(x)>n) { int x; memset(vis, 0, sizeof(vis)); memset(dp, 0, sizeof(dp)); for(int i = 0; i < n; i++) { scanf("%d",&x); vis[x] ++; } dp[1][1] = vis[1]; dp[2][1] = vis[2]*2; dp[2][0] = dp[1][1]; for(int i = 3; i <= maxn-10; i++) { dp[i][1] = max(dp[i-2][0], dp[i-2][1])+vis[i]*i; dp[i][0] = max(dp[i-1][0], dp[i-1][1]); } cout<

    聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    codeforces260div2A,B,C_html/css

    codeforces260div2A,B,C_html/css_WEB-ITnose:A:水題,結構體排序后,看兩個數組的是否序列相同。 B:分別寫出來1,2,3,4,的n次方對5取余。你會發現和對5取余有一個循環節。如果%4 = 0,輸出4,否則輸出0. 寫一個大數取余就過了。 B. Fedya and Maths time limit per test
    推薦度:
    標簽: it cc 2a
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 无码人妻精品一区二区三区东京热| 精品熟女少妇a∨免费久久| 最新精品国偷自产在线| 欧美日韩精品在线| 亚洲欧美精品SUV| 精品人妻少妇一区二区三区不卡| 99热精品在线| 老司机亚洲精品影院无码| 无码欧精品亚洲日韩一区夜夜嗨 | 欧美精品一区二区三区在线| 久久99国内精品自在现线| 亚洲国产精品成人AV无码久久综合影院| 99亚洲精品视频| 久久精品国产福利国产秒| 91精品国产乱码久久久久久| 久久久久99精品成人片欧美| 午夜精品久久影院蜜桃| 久久国产精品波多野结衣AV| 国产精品亚洲w码日韩中文| 午夜精品免费在线观看| 欧美日韩精品一区二区在线播放| 国产精品视频一区二区三区经| 国产精品禁18久久久夂久| 国产精品揄拍100视频| 欧美精品欧美人与动人物牲交| 亚洲精品无码久久久久去q| 中日韩产精品1卡二卡三卡| 亚洲精品一级无码鲁丝片| 亚洲国产精品不卡毛片a在线| 免费精品国自产拍在线播放| 久久九九久精品国产免费直播| 国产啪亚洲国产精品无码| 国产精品色视频ⅹxxx| 国产高清在线精品一区二区三区 | 精品无码国产一区二区三区AV | 日韩精品一区二区三区影院| 久久久久亚洲精品中文字幕| 欧美精品成人3d在线| 无码精品蜜桃一区二区三区WW | 久久精品国产亚洲AV无码娇色| 久久精品国产亚洲AV电影|