結果
| 問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-06 18:24:34 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 82,772 KB |
| 実行使用メモリ | 71,208 KB |
| 最終ジャッジ日時 | 2025-09-06 18:24:37 |
| 合計ジャッジ時間 | 2,851 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
N = int(input())
l = []
r = []
for i in range(N):
L,R = map(int, input().split())
l.append(L)
r.append(R)
from itertools import permutations
ans = 0
for pt in permutations([i for i in range(N)]):
now = 0
flag = True
for _ in range(len(pt)):
L,R = l[pt[_]],r[pt[_]]
if now < L:
now = L
elif L <= now <= R:
continue
else:
flag = False
if flag:
ans += 1
print(ans)