結果
問題 |
No.1673 Lamps on a line
|
ユーザー |
|
提出日時 | 2021-09-10 23:14:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 347 bytes |
コンパイル時間 | 606 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 25,108 KB |
最終ジャッジ日時 | 2024-06-12 03:48:24 |
合計ジャッジ時間 | 5,218 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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()