結果
問題 |
No.1184 Hà Nội
|
ユーザー |
|
提出日時 | 2020-09-29 04:13:06 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 230 bytes |
コンパイル時間 | 185 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-03 06:32:34 |
合計ジャッジ時間 | 3,896 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 14 |
コンパイルメッセージ
Syntax OK
ソースコード
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 l = [l, n].min n = n - l + 1 puts (pow2mod(n) - 1) % D