結果

問題 No.1673 Lamps on a line
ユーザー ibukitiibukiti
提出日時 2021-09-11 10:04:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 253 bytes
コンパイル時間 1,008 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 7,916 KB
最終ジャッジ日時 2023-09-04 18:56:19
合計ジャッジ時間 7,064 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,916 KB
testcase_01 AC 15 ms
7,784 KB
testcase_02 AC 342 ms
7,816 KB
testcase_03 AC 340 ms
7,776 KB
testcase_04 AC 585 ms
7,868 KB
testcase_05 AC 44 ms
7,840 KB
testcase_06 AC 512 ms
7,788 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
anslist=[0]*n
for _ in range(q):
    l,r=map(int,input().split())
    for i in range(l-1,r):
        if anslist[i]==0:
            anslist[i]=1
        elif anslist[i]==1:
            anslist[i]=0
    print(anslist.count(1))
0