結果
| 問題 |
No.1673 Lamps on a line
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-30 11:43:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 323 bytes |
| コンパイル時間 | 182 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 153,268 KB |
| 最終ジャッジ日時 | 2024-11-14 10:40:39 |
| 合計ジャッジ時間 | 17,664 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 TLE * 5 |
ソースコード
N,Q = map(int,input().split())
switch = ['0']*(N+1)
for i in range(Q):
L,R = map(int,input().split())
for j in range(L-1,R+1):
if switch[j] == '0' and L <= j and j <= R:
switch[j] = '1'
elif switch[j] == '1' and L <= j and j <= R:
switch[j] = '0'
print(switch.count('1'))