結果
| 問題 | No.1557 Binary Variable |
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-01-09 16:27:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 121 ms / 2,000 ms |
| コード長 | 340 bytes |
| 記録 | |
| コンパイル時間 | 178 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 91,788 KB |
| 最終ジャッジ日時 | 2026-05-26 23:01:07 |
| 合計ジャッジ時間 | 8,493 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
import sys
readline = sys.stdin.readline
N, M = map(int, readline().split())
D = []
for i in range(M):
L, R = map(int, readline().split())
D.append((L, R))
D.sort(reverse=True)
ans = N
pre = 10 ** 18
for i in range(M):
L, R = D[i]
if R >= pre:
continue
else:
ans -= 1
pre = L
print(ans)
rlangevin