結果
| 問題 | No.1557 Binary Variable |
| コンテスト | |
| ユーザー |
c-yan
|
| 提出日時 | 2021-06-26 00:29:57 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
AC
|
| 実行時間 | 598 ms / 2,000 ms |
| コード長 | 286 bytes |
| 記録 | |
| コンパイル時間 | 102 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 54,532 KB |
| 最終ジャッジ日時 | 2024-06-25 09:02:20 |
| 合計ジャッジ時間 | 20,789 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
from sys import stdin
readline = stdin.readline
N, M = map(int, readline().split())
LR = [list(map(int, readline().split())) for _ in range(M)]
result = N
t = -1
for L, R in sorted(LR, key=lambda x: x[1]):
if L <= t <= R:
continue
result -= 1
t = R
print(result)
c-yan