結果

問題 No.1673 Lamps on a line
ユーザー mahiro72
提出日時 2021-10-03 02:12:57
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 191 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 31,648 KB
最終ジャッジ日時 2024-07-20 21:16:42
合計ジャッジ時間 6,135 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
lr = [list(map(int,input().split()))for _ in range(Q)]
s = [0]*(N+1)
for l,r in lr:
    for i in range(l-1,r):
        s[i]+=1
        s[i]%=2
    print(sum(s))
0