結果

問題 No.2055 12x34...
ユーザー Yilin FeiYilin Fei
提出日時 2024-01-08 18:31:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 248 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 1,792 ms
コンパイル使用メモリ 178,284 KB
実行使用メモリ 26,752 KB
最終ジャッジ日時 2024-01-08 18:31:44
合計ジャッジ時間 7,773 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 7 ms
6,676 KB
testcase_03 AC 13 ms
6,676 KB
testcase_04 AC 17 ms
6,676 KB
testcase_05 AC 18 ms
6,676 KB
testcase_06 AC 16 ms
6,676 KB
testcase_07 AC 13 ms
6,676 KB
testcase_08 AC 10 ms
6,676 KB
testcase_09 AC 19 ms
6,676 KB
testcase_10 AC 20 ms
6,676 KB
testcase_11 AC 10 ms
6,676 KB
testcase_12 AC 158 ms
17,280 KB
testcase_13 AC 235 ms
25,856 KB
testcase_14 AC 79 ms
12,672 KB
testcase_15 AC 77 ms
12,800 KB
testcase_16 AC 248 ms
26,752 KB
testcase_17 AC 52 ms
6,676 KB
testcase_18 AC 107 ms
7,808 KB
testcase_19 AC 19 ms
6,676 KB
testcase_20 AC 7 ms
6,676 KB
testcase_21 AC 19 ms
6,676 KB
testcase_22 AC 145 ms
9,088 KB
testcase_23 AC 152 ms
12,928 KB
testcase_24 AC 91 ms
16,896 KB
testcase_25 AC 140 ms
14,208 KB
testcase_26 AC 125 ms
14,592 KB
testcase_27 AC 106 ms
17,280 KB
testcase_28 AC 114 ms
15,360 KB
testcase_29 AC 152 ms
16,512 KB
testcase_30 AC 130 ms
14,336 KB
testcase_31 AC 120 ms
14,208 KB
testcase_32 AC 117 ms
14,848 KB
testcase_33 AC 61 ms
6,676 KB
testcase_34 AC 62 ms
6,676 KB
testcase_35 AC 61 ms
6,676 KB
testcase_36 AC 61 ms
6,676 KB
testcase_37 AC 63 ms
6,676 KB
testcase_38 AC 61 ms
6,676 KB
testcase_39 AC 64 ms
6,676 KB
testcase_40 AC 62 ms
6,676 KB
testcase_41 AC 62 ms
6,676 KB
testcase_42 AC 62 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    map<ll, ll> cnt;
    ll n, ans = 0;
    cin >> n;
    vector<ll> a(n);
    for (auto& x : a) cin >> x;
    for (ll i = 0; i < n; i++) {
        cnt[a[i]]++;
        cnt[a[i]] += cnt[a[i] - 1];
        cnt[a[i]] %= mod;
    }
    for (auto& i : cnt) ans = (ans + i.second) % mod;
    ans = (ans + mod - n) % mod;
    cout << ans << '\n';
}
0