結果
| 問題 | No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-06 13:54:37 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 565 bytes |
| 記録 | |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 96,112 KB |
| 実行使用メモリ | 84,096 KB |
| 最終ジャッジ日時 | 2026-07-14 19:42:08 |
| 合計ジャッジ時間 | 13,024 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 WA * 4 |
ソースコード
from itertools import permutations
N=int(input())
mem=[]
for _ in range(N):
L, R = map(int, input().split())
mem.append([L, R])
ans=0
for perm in permutations(mem):
idx = 0
x = 1
S = []
while x <= 3854 and idx < N:
if perm[idx][0] <= x <= perm[idx][1]:
S.append(x)
idx += 1
x += 1
if len(S) == N: # 全部埋まった
ok = True
for j in range(1, N):
if S[j-1] > S[j]:
ok = False
break
if ok:
ans += 1
print(ans)