結果

問題 No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
ユーザー akebono03
提出日時 2025-09-06 13:43:17
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 205 ms / 2,000 ms
コード長 513 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-09-06 13:43:30
合計ジャッジ時間 3,416 ms
ジャッジサーバーID
(参考情報)
judge4 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

def ip():return int(input())
def mp():return map(int, input().split())
def lmp():return list(map(int, input().split()))
# 岩プロコン2 D No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
from itertools import permutations
N = ip()
LR = [lmp() for _ in range(N)]
ans = 0
for p in permutations(range(N)):
  ok = True
  cur = LR[p[0]][0]
  for i in range(1, N):
    l, r = LR[p[i]]
    if r < cur:
      ok = False
      break
    cur = max(cur, l)
  if ok:
    ans += 1
print(ans)
0