結果

問題 No.1673 Lamps on a line
ユーザー Mik10
提出日時 2021-10-08 15:20:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 194 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 18,576 KB
最終ジャッジ日時 2024-07-23 03:22:05
合計ジャッジ時間 6,104 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = list(map(int, input().split()))
xex = 0
for i in range(q):
    l, r = list(map(int, input().split()))
    x = (pow(2, (r)) - pow(2, (l-1)))
    print(bin(x:=x^xex).count("1"))
    xex = x
0