結果
問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
ユーザー |
|
提出日時 | 2025-09-07 00:42:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 499 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 74,752 KB |
最終ジャッジ日時 | 2025-09-07 00:42:31 |
合計ジャッジ時間 | 3,115 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
N = int(input()) rng = [] for i in range(N): l, r = map(int, input().split()) rng.append((l, r)) import itertools ans = 0 for t in itertools.permutations(range(N)): inow = t[0] rnow = rng[inow][0] ok = True for i in range(1, N): inow = t[i] nowmin = rng[inow][0] nowmax = rng[inow][1] if nowmax < rnow: ok = False break else: rnow = max(rnow, nowmin) if ok == True: ans += 1 print(ans)