b495: Permutations
標籤 :
通過比率 : 1人/1人 ( 100% ) [非即時]
評分方式:
Special

最近更新 : 2026-08-29 20:00

內容

A permutation of integers $1,2\dots,n$ is called beautiful if there are no adjacent elements whose difference is $1$.

Given $n$, construct a beautiful permutation if such a permutation exists.

輸入說明

輸入只有一行:$n$

輸出說明

Print a beautiful permutation of integers $1,2,\dots,n$. If there are several solutions, you may print any of them. If there are no solutions, print "NO SOLUTION".

範例輸入
3
範例輸出
NO SOLUTION
測資資訊:
記憶體限制: 64 MB
不公開 測資點#0 (5%): 1.0s , <1K
不公開 測資點#1 (5%): 1.0s , <1K
不公開 測資點#2 (5%): 1.0s , <1K
不公開 測資點#3 (5%): 1.0s , <1K
不公開 測資點#4 (5%): 1.0s , <1K
不公開 測資點#5 (5%): 1.0s , <1K
不公開 測資點#6 (5%): 1.0s , <1K
不公開 測資點#7 (5%): 1.0s , <1K
不公開 測資點#8 (5%): 1.0s , <1K
不公開 測資點#9 (5%): 1.0s , <1K
不公開 測資點#10 (5%): 1.0s , <1K
不公開 測資點#11 (5%): 1.0s , <1K
不公開 測資點#12 (5%): 1.0s , <1K
不公開 測資點#13 (5%): 1.0s , <1K
不公開 測資點#14 (5%): 1.0s , <1K
不公開 測資點#15 (5%): 1.0s , <1K
不公開 測資點#16 (5%): 1.0s , <1K
不公開 測資點#17 (5%): 1.0s , <1K
不公開 測資點#18 (5%): 1.0s , <1K
不公開 測資點#19 (5%): 1.0s , <1K
提示 :

25%: $1\leq n\leq 10$

50% $1\leq n\leq 1000$

75%: $1\leq n\leq 10^4$

100%: $1\leq n\leq 10^6$

標籤:
出處:
cses [管理者:
median (wei)
]


編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」