結果
問題 | No.1673 Lamps on a line |
ユーザー |
|
提出日時 | 2021-09-20 09:18:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 295 ms / 2,000 ms |
コード長 | 242 bytes |
コンパイル時間 | 395 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 79,872 KB |
最終ジャッジ日時 | 2024-07-02 12:55:43 |
合計ジャッジ時間 | 3,652 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 |
ソースコード
from itertools import accumulate N,Q=map(int,input().split()) lamp=[0]*(N) cnt=0 for _ in range(Q): l,r=map(int,input().split()) for i in range(l-1,r): if lamp[i]: cnt-=1 else: cnt+=1 lamp[i]=1-lamp[i] print(cnt)