結果

問題 No.1673 Lamps on a line
ユーザー Mik10Mik10
提出日時 2021-10-08 15:20:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 194 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 13,424 KB
最終ジャッジ日時 2023-09-30 09:18:15
合計ジャッジ時間 6,012 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,944 KB
testcase_01 AC 15 ms
7,844 KB
testcase_02 AC 342 ms
7,936 KB
testcase_03 AC 341 ms
7,768 KB
testcase_04 AC 597 ms
7,808 KB
testcase_05 AC 44 ms
7,956 KB
testcase_06 AC 510 ms
7,812 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

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