結果

問題 No.2055 12x34...
ユーザー CleyLCleyL
提出日時 2022-08-21 19:16:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 824 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 25,472 KB
最終ジャッジ日時 2024-04-18 13:09:11
合計ジャッジ時間 6,121 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 10 ms
6,944 KB
testcase_03 AC 22 ms
6,940 KB
testcase_04 AC 28 ms
6,940 KB
testcase_05 AC 30 ms
6,940 KB
testcase_06 AC 29 ms
6,940 KB
testcase_07 AC 22 ms
6,940 KB
testcase_08 AC 17 ms
6,940 KB
testcase_09 AC 34 ms
6,940 KB
testcase_10 AC 38 ms
6,944 KB
testcase_11 AC 16 ms
6,944 KB
testcase_12 AC 174 ms
16,640 KB
testcase_13 AC 289 ms
24,704 KB
testcase_14 AC 90 ms
12,416 KB
testcase_15 AC 109 ms
12,544 KB
testcase_16 AC 313 ms
25,472 KB
testcase_17 AC 69 ms
6,944 KB
testcase_18 AC 129 ms
6,940 KB
testcase_19 AC 25 ms
6,940 KB
testcase_20 AC 10 ms
6,940 KB
testcase_21 AC 27 ms
6,944 KB
testcase_22 AC 178 ms
7,680 KB
testcase_23 AC 161 ms
11,392 KB
testcase_24 AC 126 ms
15,488 KB
testcase_25 AC 159 ms
12,928 KB
testcase_26 AC 146 ms
13,184 KB
testcase_27 AC 135 ms
15,872 KB
testcase_28 AC 139 ms
13,824 KB
testcase_29 AC 165 ms
15,232 KB
testcase_30 AC 149 ms
13,056 KB
testcase_31 AC 134 ms
12,928 KB
testcase_32 AC 137 ms
13,568 KB
testcase_33 AC 74 ms
6,944 KB
testcase_34 AC 74 ms
6,944 KB
testcase_35 AC 73 ms
6,940 KB
testcase_36 AC 75 ms
6,940 KB
testcase_37 AC 77 ms
6,940 KB
testcase_38 AC 72 ms
6,940 KB
testcase_39 AC 75 ms
6,940 KB
testcase_40 AC 77 ms
6,940 KB
testcase_41 AC 75 ms
6,944 KB
testcase_42 AC 75 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;
const long long MOD = 998244353;
int main(){
    int n;cin>>n;
    map<int,long long> A;
    for(int i = 0; n > i; i++){
        int x;cin>>x;
        A[x]=(A[x]+1+A[x-1])%MOD;
    }
    long long ans = MOD-n;
    for(auto x: A){
        ans = (ans+x.second)%MOD;
    }
    cout << ans << endl;
    
}
0