結果

問題 No.1673 Lamps on a line
ユーザー jamesjames
提出日時 2021-09-10 21:58:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 268 bytes
コンパイル時間 1,164 ms
コンパイル使用メモリ 86,704 KB
実行使用メモリ 80,420 KB
最終ジャッジ日時 2023-09-02 17:25:48
合計ジャッジ時間 7,582 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,136 KB
testcase_01 AC 72 ms
71,116 KB
testcase_02 AC 305 ms
79,624 KB
testcase_03 AC 275 ms
80,420 KB
testcase_04 AC 359 ms
79,348 KB
testcase_05 AC 136 ms
77,540 KB
testcase_06 AC 322 ms
77,720 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
lamp = [0] * N

for i in range(Q):
    Li,Ri = map(int,input().split())
    for j in range(Li,Ri+1):
        if lamp[j-1] == 0:
            lamp[j-1] = 1
        else:
            lamp[j-1] = 0
    print(len([1 for k in lamp if k == 1]))
0