結果

問題 No.2055 12x34...
ユーザー t98slidert98slider
提出日時 2022-08-21 12:58:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 484 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 1,752 ms
コンパイル使用メモリ 172,924 KB
実行使用メモリ 48,000 KB
最終ジャッジ日時 2024-04-18 12:45:03
合計ジャッジ時間 8,254 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 11 ms
5,376 KB
testcase_03 AC 21 ms
5,376 KB
testcase_04 AC 27 ms
5,376 KB
testcase_05 AC 29 ms
5,376 KB
testcase_06 AC 27 ms
5,376 KB
testcase_07 AC 21 ms
5,376 KB
testcase_08 AC 17 ms
5,376 KB
testcase_09 AC 35 ms
5,376 KB
testcase_10 AC 39 ms
5,376 KB
testcase_11 AC 15 ms
5,376 KB
testcase_12 AC 262 ms
29,824 KB
testcase_13 AC 481 ms
46,208 KB
testcase_14 AC 145 ms
21,228 KB
testcase_15 AC 181 ms
21,520 KB
testcase_16 AC 484 ms
48,000 KB
testcase_17 AC 75 ms
7,168 KB
testcase_18 AC 148 ms
10,240 KB
testcase_19 AC 29 ms
5,376 KB
testcase_20 AC 11 ms
5,376 KB
testcase_21 AC 29 ms
5,376 KB
testcase_22 AC 205 ms
12,288 KB
testcase_23 AC 197 ms
19,968 KB
testcase_24 AC 163 ms
28,032 KB
testcase_25 AC 204 ms
22,656 KB
testcase_26 AC 194 ms
23,296 KB
testcase_27 AC 182 ms
28,800 KB
testcase_28 AC 177 ms
24,832 KB
testcase_29 AC 228 ms
27,264 KB
testcase_30 AC 191 ms
22,912 KB
testcase_31 AC 176 ms
22,528 KB
testcase_32 AC 176 ms
23,808 KB
testcase_33 AC 84 ms
5,376 KB
testcase_34 AC 86 ms
5,376 KB
testcase_35 AC 88 ms
5,376 KB
testcase_36 AC 88 ms
5,376 KB
testcase_37 AC 87 ms
5,376 KB
testcase_38 AC 84 ms
5,376 KB
testcase_39 AC 88 ms
5,376 KB
testcase_40 AC 84 ms
5,376 KB
testcase_41 AC 81 ms
5,376 KB
testcase_42 AC 85 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &&v:a)cin >> v;
    map<int,ll> mp1, mp2;
    for(int i = 0; i < n; i++){
        (mp2[a[i]] += mp1[a[i] - 1] + mp2[a[i] - 1]) %= 998244353;
        mp1[a[i]]++;
    }
    ll ans = 0;
    for(auto &&p:mp2){
        (ans += p.second) %= 998244353;
    }
    cout << ans << endl;
}
0