結果
問題 |
No.1742 Binary Indexed Train
|
ユーザー |
|
提出日時 | 2021-11-14 18:02:35 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 223 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 21,376 KB |
最終ジャッジ日時 | 2024-11-30 00:34:39 |
合計ジャッジ時間 | 69,652 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 TLE * 11 |
ソースコード
n, q = map(int, input().split()) for _ in range(q): s, t = map(int, input().split()) ans = 0 s += 1 << n; t += 1 << n while s < t: if s & 1: ans += 1; s += 1 if t & 1: ans += 1; t -= 1 s >>= 1; t >>= 1 print(ans)