結果

問題 No.3477 Yet Another LIS Triangle
コンテスト
ユーザー Unbakedbread
提出日時 2026-10-08 22:32:58
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 132 ms / 2,000 ms
+ 999µs
コード長 373 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 61 ms
コンパイル使用メモリ 81,540 KB
実行使用メモリ 100,468 KB
最終ジャッジ日時 2026-10-08 22:33:12
合計ジャッジ時間 4,906 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

for _ in range(int(input())):
	N, K = map(int, input().split())
	if K == 1 or K == N:
		print("No")
		continue
	
	V = [0]
	for i in range(N - 2, K - 1, -1):
		V.append(i)
	for i in range(1, K):
		V.append(i)
	
	P = []
	for k in range(3):
		P += [x * 3 + k + 1 for x in V]
	P.append(P[0])
	
	print("Yes")
	print(*P[:N])
	print(*P[N - 1 : N * 2 - 1])
	print(*P[N * 2 - 2:])
	
0