結果

問題 No.1673 Lamps on a line
コンテスト
ユーザー thes
提出日時 2021-09-11 01:07:01
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 324 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,867 ms
コンパイル使用メモリ 95,848 KB
実行使用メモリ 335,172 KB
最終ジャッジ日時 2026-07-26 04:54:41
合計ジャッジ時間 5,401 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from sys import stdin


def main(inp, inps):
    N, Q = map(int, inp().split())
    L, R = list(zip(*map(lambda x: list(map(int, x.split())), inps())))
    now_bit = 0
    for l, r in zip(L, R):
        now_bit ^= 2**r - 2**(l-1)
        print(sum(map(int, list(bin(now_bit)[2:])))) 


main(stdin.readline, stdin.readlines)
0