結果

問題 No.2055 12x34...
ユーザー kotatsugamekotatsugame
提出日時 2022-08-21 12:53:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 78,944 KB
実行使用メモリ 12,680 KB
最終ジャッジ日時 2023-07-31 12:24:48
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 10 ms
4,380 KB
testcase_03 AC 21 ms
4,380 KB
testcase_04 AC 28 ms
4,376 KB
testcase_05 AC 30 ms
4,380 KB
testcase_06 AC 27 ms
4,376 KB
testcase_07 AC 21 ms
4,380 KB
testcase_08 AC 16 ms
4,380 KB
testcase_09 AC 33 ms
4,376 KB
testcase_10 AC 35 ms
4,380 KB
testcase_11 AC 15 ms
4,376 KB
testcase_12 AC 100 ms
8,372 KB
testcase_13 AC 163 ms
11,256 KB
testcase_14 AC 60 ms
6,668 KB
testcase_15 AC 60 ms
6,716 KB
testcase_16 AC 186 ms
11,636 KB
testcase_17 AC 55 ms
4,744 KB
testcase_18 AC 109 ms
5,776 KB
testcase_19 AC 21 ms
4,376 KB
testcase_20 AC 9 ms
4,384 KB
testcase_21 AC 21 ms
4,376 KB
testcase_22 AC 147 ms
6,456 KB
testcase_23 AC 136 ms
9,280 KB
testcase_24 AC 112 ms
12,416 KB
testcase_25 AC 135 ms
10,348 KB
testcase_26 AC 125 ms
10,612 KB
testcase_27 AC 114 ms
12,680 KB
testcase_28 AC 120 ms
11,236 KB
testcase_29 AC 146 ms
12,012 KB
testcase_30 AC 132 ms
10,572 KB
testcase_31 AC 124 ms
10,340 KB
testcase_32 AC 123 ms
10,816 KB
testcase_33 AC 70 ms
4,380 KB
testcase_34 AC 71 ms
4,376 KB
testcase_35 AC 70 ms
4,376 KB
testcase_36 AC 71 ms
4,380 KB
testcase_37 AC 72 ms
4,380 KB
testcase_38 AC 70 ms
4,380 KB
testcase_39 AC 71 ms
4,380 KB
testcase_40 AC 72 ms
4,380 KB
testcase_41 AC 71 ms
4,376 KB
testcase_42 AC 71 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
int main()
{
    int N;
    cin>>N;
    map<int,mint>mp;
    mint ans=0;
    for(int i=0;i<N;i++)
    {
        int A;cin>>A;
        mint prv=0;
        if(mp.find(A-1)!=mp.end())prv=mp[A-1];
        ans+=prv;
        mp[A]+=prv+1;
    }
    cout<<ans.val()<<endl;
}
0