結果

問題 No.1673 Lamps on a line
ユーザー TomoyarnTomoyarn
提出日時 2022-02-16 05:25:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 278 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 84,500 KB
最終ジャッジ日時 2023-09-11 17:06:54
合計ジャッジ時間 6,672 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
75,800 KB
testcase_01 AC 68 ms
71,172 KB
testcase_02 AC 255 ms
79,428 KB
testcase_03 AC 246 ms
78,968 KB
testcase_04 AC 330 ms
78,644 KB
testcase_05 AC 126 ms
78,224 KB
testcase_06 AC 296 ms
78,272 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder No.1673 Lamps on a line
N, Q = map(int, input().split())

lamp = [0] * N

for _ in range(Q):
    L, R = map(int, input().split())
    for i in range(L - 1, R):
        if lamp[i] == 0:
            lamp[i] = 1
        else:
            lamp[i] = 0
    print(sum(lamp))
0