結果

問題 No.1673 Lamps on a line
ユーザー harapecoharapeco
提出日時 2022-03-30 11:57:10
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 248 bytes
コンパイル時間 483 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 78,592 KB
最終ジャッジ日時 2024-04-26 20:11:48
合計ジャッジ時間 5,551 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
56,960 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 204 ms
76,928 KB
testcase_03 AC 206 ms
77,184 KB
testcase_04 AC 288 ms
76,800 KB
testcase_05 AC 93 ms
76,544 KB
testcase_06 AC 254 ms
76,544 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
switch = [0]*(N)
for i in range(Q):
    L,R = map(int,input().split())
    for j in range(L-1,R):
        if switch[j] == 0:
            switch[j] = 1
        else:
            switch[j] = 0
    print(switch.count(1))
0