結果

問題 No.1673 Lamps on a line
ユーザー ibukiti
提出日時 2021-09-11 10:04:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 253 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,588 KB
最終ジャッジ日時 2024-06-22 16:42:03
合計ジャッジ時間 6,984 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
anslist=[0]*n
for _ in range(q):
    l,r=map(int,input().split())
    for i in range(l-1,r):
        if anslist[i]==0:
            anslist[i]=1
        elif anslist[i]==1:
            anslist[i]=0
    print(anslist.count(1))
0