結果

問題 No.1673 Lamps on a line
ユーザー ThetaTheta
提出日時 2022-11-01 19:16:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 270 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 13,396 KB
最終ジャッジ日時 2023-09-23 09:45:47
合計ジャッジ時間 6,733 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,020 KB
testcase_01 AC 17 ms
7,844 KB
testcase_02 AC 326 ms
7,840 KB
testcase_03 AC 326 ms
7,836 KB
testcase_04 AC 549 ms
7,892 KB
testcase_05 AC 43 ms
7,836 KB
testcase_06 AC 477 ms
7,876 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, Q = map(int, input().split())
    condition = 0
    for _ in range(Q):
        L, R = map(int, input().split())
        condition = condition ^ (2**R - 2**(L-1))
        print(format(condition, "b").count("1"))


if __name__ == "__main__":
    main()
0