結果
問題 |
No.1673 Lamps on a line
|
ユーザー |
|
提出日時 | 2021-09-10 23:19:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 407 bytes |
コンパイル時間 | 149 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 25,868 KB |
最終ジャッジ日時 | 2024-06-12 04:02:52 |
合計ジャッジ時間 | 4,795 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 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 = 0 for i in range(len(a)): if n & 1 << i: ans += 1 print(ans) main()