結果
問題 | No.1742 Binary Indexed Train |
ユーザー |
![]() |
提出日時 | 2022-06-16 04:13:32 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,392 ms / 3,000 ms |
コード長 | 426 bytes |
コンパイル時間 | 263 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 79,952 KB |
最終ジャッジ日時 | 2024-10-05 11:33:06 |
合計ジャッジ時間 | 18,834 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
import sysinput = sys.stdin.readlineN,Q=map(int,input().split())for tests in range(Q):s,t=map(int,input().split())ANS=0while s<t:fb=Nfor i in range(N):if s & (1<<i) != 0 :fb=ibreakfor i in range(fb,-1,-1):if s+(1<<i)<=t:ANS+=1s+=(1<<i)breakprint(ANS)