結果

問題 No.1325 Subsequence Score
ユーザー simansiman
提出日時 2023-08-02 13:57:31
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 206 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 48,128 KB
最終ジャッジ日時 2024-04-20 14:01:08
合計ジャッジ時間 8,215 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
12,160 KB
testcase_01 AC 78 ms
12,288 KB
testcase_02 AC 77 ms
12,160 KB
testcase_03 AC 81 ms
12,160 KB
testcase_04 AC 81 ms
12,288 KB
testcase_05 AC 83 ms
12,288 KB
testcase_06 AC 99 ms
12,288 KB
testcase_07 AC 76 ms
12,288 KB
testcase_08 AC 76 ms
12,288 KB
testcase_09 AC 75 ms
12,160 KB
testcase_10 AC 76 ms
12,288 KB
testcase_11 AC 74 ms
12,160 KB
testcase_12 AC 78 ms
12,160 KB
testcase_13 AC 301 ms
47,616 KB
testcase_14 AC 138 ms
21,888 KB
testcase_15 AC 267 ms
42,496 KB
testcase_16 AC 284 ms
46,080 KB
testcase_17 AC 167 ms
26,112 KB
testcase_18 AC 128 ms
20,096 KB
testcase_19 AC 296 ms
47,872 KB
testcase_20 AC 107 ms
16,640 KB
testcase_21 AC 150 ms
23,936 KB
testcase_22 AC 169 ms
26,752 KB
testcase_23 AC 302 ms
48,000 KB
testcase_24 AC 358 ms
48,128 KB
testcase_25 AC 311 ms
48,000 KB
testcase_26 AC 305 ms
47,872 KB
testcase_27 AC 302 ms
47,872 KB
testcase_28 AC 77 ms
12,160 KB
testcase_29 AC 78 ms
12,160 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

MOD = 998_244_353
N = gets.to_i
A = gets.split.map(&:to_i)

if N == 1
  puts A.first
  exit
end

ans = 0

1.upto(N) do |i|
  ans += (i + 1) * A[i - 1]
  ans %= MOD
end

puts (2.pow(N - 2, MOD) * ans) % MOD
0