結果

問題 No.2055 12x34...
ユーザー butsurizukibutsurizuki
提出日時 2022-08-21 04:11:39
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 9,921 ms
コンパイル使用メモリ 356,436 KB
実行使用メモリ 33,716 KB
最終ジャッジ日時 2024-04-18 01:46:04
合計ジャッジ時間 15,405 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 9 ms
5,376 KB
testcase_03 AC 19 ms
5,376 KB
testcase_04 AC 25 ms
6,792 KB
testcase_05 AC 27 ms
6,888 KB
testcase_06 AC 25 ms
6,888 KB
testcase_07 AC 19 ms
5,732 KB
testcase_08 AC 14 ms
5,376 KB
testcase_09 AC 29 ms
7,036 KB
testcase_10 AC 31 ms
7,144 KB
testcase_11 AC 15 ms
5,376 KB
testcase_12 AC 159 ms
21,356 KB
testcase_13 AC 298 ms
32,512 KB
testcase_14 AC 99 ms
15,352 KB
testcase_15 AC 100 ms
15,740 KB
testcase_16 AC 313 ms
33,716 KB
testcase_17 AC 68 ms
9,056 KB
testcase_18 AC 134 ms
13,824 KB
testcase_19 AC 25 ms
5,852 KB
testcase_20 AC 10 ms
5,376 KB
testcase_21 AC 25 ms
5,856 KB
testcase_22 AC 177 ms
17,132 KB
testcase_23 AC 168 ms
17,900 KB
testcase_24 AC 118 ms
22,000 KB
testcase_25 AC 166 ms
19,432 KB
testcase_26 AC 153 ms
19,568 KB
testcase_27 AC 134 ms
22,640 KB
testcase_28 AC 141 ms
20,588 KB
testcase_29 AC 179 ms
21,740 KB
testcase_30 AC 154 ms
19,564 KB
testcase_31 AC 141 ms
19,432 KB
testcase_32 AC 139 ms
20,076 KB
testcase_33 AC 76 ms
9,244 KB
testcase_34 AC 77 ms
9,328 KB
testcase_35 AC 77 ms
9,200 KB
testcase_36 AC 77 ms
9,104 KB
testcase_37 AC 78 ms
9,328 KB
testcase_38 AC 77 ms
9,324 KB
testcase_39 AC 78 ms
9,192 KB
testcase_40 AC 78 ms
9,320 KB
testcase_41 AC 77 ms
9,320 KB
testcase_42 AC 76 ms
9,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "testlib.h"
#include <bits/stdc++.h>
#define mod 998244353

using namespace std;

int main(int argc, char* argv[]){
  registerValidation(argc, argv);

  long long n=inf.readLong(2ll,200000ll);inf.readEoln();
  vector<long long> a=inf.readLongs(n,1ll,1000000000ll);inf.readEoln();
  inf.readEof();
  map<long long,long long> dp;
  for(int i=0;i<n;i++){
    dp[a[i]]++;
    dp[a[i]]+=dp[a[i]-1];
    dp[a[i]]%=mod;
  }
  long long res=0;
  for(auto &nx : dp){
    res+=nx.second;res%=mod;
  }
  res+=(mod-n);res%=mod;
  cout << res << "\n";
  return 0;
}
0