結果

問題 No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
ユーザー N-noa21
提出日時 2025-09-06 18:22:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 82,208 KB
実行使用メモリ 70,760 KB
最終ジャッジ日時 2025-09-06 18:22:57
合計ジャッジ時間 3,272 ms
ジャッジサーバーID
(参考情報)
judge1 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

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
   # print(now)
    if flag:
        ans += 1
print(ans)
0