結果
| 問題 |
No.1673 Lamps on a line
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-09-10 21:24:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 269 ms / 2,000 ms |
| コード長 | 194 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 82,356 KB |
| 実行使用メモリ | 80,024 KB |
| 最終ジャッジ日時 | 2024-06-11 22:21:20 |
| 合計ジャッジ時間 | 3,111 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 |
ソースコード
n,Q = map(int,input().split())
ans = 0
res = [-1]*(n+2)
for _ in range(Q):
L,R = map(int,input().split())
for i in range(L,R+1):
ans -= res[i]
res[i] *= -1
print(ans)
convexineq