結果

問題 No.916 Encounter On A Tree
コンテスト
ユーザー 👑 tails
提出日時 2023-03-09 12:03:56
言語 cLay
(20250308-1 + boost 1.89.0)
コンパイル:
clayc _filename_
実行:
./a.out
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 168 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,312 ms
コンパイル使用メモリ 195,316 KB
実行使用メモリ 11,904 KB
最終ジャッジ日時 2026-04-06 13:13:42
合計ジャッジ時間 4,877 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 56
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

Comb<Mint>c;
ll@d,@l,@r,@k;
(l,r)=Ilog2_f((l,r));
Mint p=(l+r-k&1)<(r-l<=k<=l+r);
p*=c.fac(1<<(0..d-1));
ll m=l+r-k>>1;
wt(l<r?p/(1<<m+(l>m)):p/((1<<r)-1)*(1<<r-m-1));
0