結果

問題 No.2055 12x34...
ユーザー tomeruntomerun
提出日時 2022-08-21 13:01:02
言語 Crystal
(1.11.2)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 237 bytes
コンパイル時間 11,628 ms
コンパイル使用メモリ 296,712 KB
実行使用メモリ 30,976 KB
最終ジャッジ日時 2024-04-18 12:46:19
合計ジャッジ時間 14,590 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 9 ms
5,376 KB
testcase_03 AC 19 ms
7,808 KB
testcase_04 AC 24 ms
9,216 KB
testcase_05 AC 27 ms
10,752 KB
testcase_06 AC 23 ms
9,088 KB
testcase_07 AC 19 ms
7,808 KB
testcase_08 AC 17 ms
6,784 KB
testcase_09 AC 28 ms
10,608 KB
testcase_10 AC 32 ms
12,800 KB
testcase_11 AC 13 ms
5,760 KB
testcase_12 AC 38 ms
19,200 KB
testcase_13 AC 64 ms
30,720 KB
testcase_14 AC 29 ms
17,152 KB
testcase_15 AC 28 ms
17,280 KB
testcase_16 AC 69 ms
30,976 KB
testcase_17 AC 18 ms
8,832 KB
testcase_18 AC 32 ms
12,480 KB
testcase_19 AC 9 ms
5,504 KB
testcase_20 AC 5 ms
5,376 KB
testcase_21 AC 9 ms
5,632 KB
testcase_22 AC 43 ms
16,996 KB
testcase_23 AC 46 ms
17,152 KB
testcase_24 AC 49 ms
20,096 KB
testcase_25 AC 48 ms
19,456 KB
testcase_26 AC 49 ms
19,456 KB
testcase_27 AC 47 ms
21,760 KB
testcase_28 AC 51 ms
19,712 KB
testcase_29 AC 50 ms
19,968 KB
testcase_30 AC 48 ms
19,456 KB
testcase_31 AC 47 ms
19,328 KB
testcase_32 AC 51 ms
19,584 KB
testcase_33 AC 34 ms
16,000 KB
testcase_34 AC 35 ms
16,128 KB
testcase_35 AC 36 ms
16,000 KB
testcase_36 AC 35 ms
16,000 KB
testcase_37 AC 34 ms
16,000 KB
testcase_38 AC 35 ms
16,000 KB
testcase_39 AC 35 ms
16,128 KB
testcase_40 AC 34 ms
16,000 KB
testcase_41 AC 33 ms
16,000 KB
testcase_42 AC 35 ms
15,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353i64
n = read_line.to_i
a = read_line.split.map(&.to_i)
count = Hash(Int32, Int64).new { |h, k| h[k] = 0i64 }
n.times do |i|
  v = a[i]
  count[v] = (count[v] + count[v - 1] + 1) % MOD
end
puts (count.values.sum - n) % MOD
0