結果

問題 No.1184 Hà Nội
ユーザー shi-moshi-mo
提出日時 2020-09-29 04:44:14
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 11,356 KB
実行使用メモリ 15,404 KB
最終ジャッジ日時 2023-09-16 05:45:11
合計ジャッジ時間 4,620 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,328 KB
testcase_01 AC 85 ms
15,236 KB
testcase_02 AC 84 ms
15,024 KB
testcase_03 AC 85 ms
15,256 KB
testcase_04 AC 83 ms
15,136 KB
testcase_05 AC 84 ms
15,256 KB
testcase_06 AC 84 ms
15,300 KB
testcase_07 AC 84 ms
15,140 KB
testcase_08 AC 84 ms
15,100 KB
testcase_09 AC 84 ms
15,340 KB
testcase_10 AC 85 ms
15,100 KB
testcase_11 AC 83 ms
15,028 KB
testcase_12 AC 82 ms
15,300 KB
testcase_13 AC 81 ms
15,164 KB
testcase_14 AC 83 ms
15,244 KB
testcase_15 AC 82 ms
15,096 KB
testcase_16 AC 82 ms
15,328 KB
testcase_17 AC 82 ms
15,236 KB
testcase_18 AC 82 ms
15,140 KB
testcase_19 AC 83 ms
15,084 KB
testcase_20 AC 83 ms
15,316 KB
testcase_21 AC 83 ms
15,028 KB
testcase_22 WA -
testcase_23 AC 82 ms
15,148 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 81 ms
15,260 KB
testcase_28 AC 83 ms
15,152 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

def pow2mod(n)
  raise 'must not happen' if n < 0
  return 1 if 0 == n
  p = pow2mod(n/2) ** 2
  p *= 2 if 1 == n%2
  p % D
end

n = (n.to_f / l).ceil
puts (pow2mod(n) - 1) % D
0