結果
問題 | No.1673 Lamps on a line |
ユーザー |
|
提出日時 | 2021-09-10 23:15:35 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 347 bytes |
コンパイル時間 | 1,043 ms |
コンパイル使用メモリ | 81,960 KB |
実行使用メモリ | 201,384 KB |
最終ジャッジ日時 | 2024-06-12 03:49:33 |
合計ジャッジ時間 | 5,824 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 TLE * 1 -- * 5 |
ソースコード
from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N, Q = map(int, input().split()) LR = [tuple(map(int, input().split())) for _ in [0] * Q] n = 0 for l, r in LR: a = "1" * (r - l + 1) + "0" * (N - r) n = n ^ int(a, 2) ans = sum(map(int, bin(n)[2:])) print(ans) main()