結果

問題 No.1184 Hà Nội
ユーザー shi-moshi-mo
提出日時 2020-09-29 04:01:31
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 180 bytes
コンパイル時間 374 ms
コンパイル使用メモリ 11,392 KB
実行使用メモリ 18,232 KB
最終ジャッジ日時 2023-09-16 04:43:29
合計ジャッジ時間 4,692 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,104 KB
testcase_01 AC 81 ms
15,060 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 WA -
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 81 ms
15,296 KB
testcase_28 AC 79 ms
15,100 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n, l = gets.split.map(&:to_i)
D = 998244353

def pow2mod(n)
  return 1 if 0 == n
  p = (pow2mod(n/2) ** 2)
  p *= 2 if 1 == n%2
  p % D
end

n = n - l + 1
puts (pow2mod(n) - 1) % D
0