結果

問題 No.3287 Golden Ring
ユーザー 回転
提出日時 2025-10-03 21:26:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 510 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,692 KB
実行使用メモリ 62,984 KB
最終ジャッジ日時 2025-10-03 21:27:01
合計ジャッジ時間 1,719 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
N = int(input())

"""
def naive(n):
    for p in permutations(range(1,n+1)):
        SUM = []
        for i in range(n):
            SUM.append(p[i]+p[(i+1)%n])
        if(len(SUM) == len(set(SUM))):
            print(p)
            exit()
naive(N)
"""

if(N == 2):
    print("No")
    exit()

if(N%2 == 0):
    ans = list(range(1,N+1))
    ans[-1],ans[-2] = ans[-2],ans[-1]
    print("Yes")
    print(*ans)
else:
    ans = list(range(1,N+1))
    print("Yes")
    print(*ans)
0