結果
| 問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-06 13:47:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 753 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 82,680 KB |
| 実行使用メモリ | 76,828 KB |
| 最終ジャッジ日時 | 2025-09-06 13:47:49 |
| 合計ジャッジ時間 | 7,437 ms |
|
ジャッジサーバーID (参考情報) |
judge / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 WA * 4 |
ソースコード
from itertools import permutations
N=int(input())
mem=[]
for i in range(N):
L, R = (int(x) for x in input().split())
mem.append([L, R])
ans=0
for i in permutations(mem):
ok=True
S=[]
for j in range(1, N):
if i[j-1][0] <= i[j][1]:
continue
else:
ok = False
if ok:
idx = 0
x = 1
while x <= 3854 and idx <= N-1:
if i[idx][0] <= x <= i[idx][1]:
S.append(x)
idx += 1
x += 1
ok2 = True
if len(S) < N:
ok2 = False
continue
for i in range(1, N):
if S[i-1] > S[i]:
ok2 = False
if ok2:
ans += 1
print(ans)