結果

問題 No.1673 Lamps on a line
ユーザー lllllll88938494
提出日時 2022-01-11 08:51:52
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 242 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,240 KB
実行使用メモリ 69,956 KB
最終ジャッジ日時 2024-11-14 11:26:32
合計ジャッジ時間 1,914 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
ns=[0]*n


for i in range(q):
    l,r=map(int,input().split())
    for i in range(l-1,r-1):
        ns[i] += 1
        if ns[i] %2 == 0:
            cnt -= 1
        else:
            cnt += 1
    print(cnt)

    
0