結果

問題 No.2719 Equal Inner Products in Permutation
ユーザー hiro1729hiro1729
提出日時 2024-04-05 23:08:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 138,060 KB
最終ジャッジ日時 2024-04-05 23:08:19
合計ジャッジ時間 8,018 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 36 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 38 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 37 ms
53,460 KB
testcase_08 AC 38 ms
53,460 KB
testcase_09 AC 37 ms
53,460 KB
testcase_10 AC 47 ms
64,164 KB
testcase_11 AC 48 ms
64,164 KB
testcase_12 AC 47 ms
62,040 KB
testcase_13 AC 46 ms
62,044 KB
testcase_14 AC 46 ms
64,164 KB
testcase_15 AC 151 ms
127,152 KB
testcase_16 AC 161 ms
133,152 KB
testcase_17 AC 128 ms
118,080 KB
testcase_18 AC 162 ms
133,284 KB
testcase_19 AC 143 ms
126,448 KB
testcase_20 AC 117 ms
114,028 KB
testcase_21 AC 164 ms
137,528 KB
testcase_22 AC 134 ms
121,584 KB
testcase_23 AC 155 ms
122,632 KB
testcase_24 AC 118 ms
113,192 KB
testcase_25 AC 168 ms
137,884 KB
testcase_26 AC 164 ms
138,060 KB
testcase_27 AC 199 ms
138,056 KB
testcase_28 AC 165 ms
137,884 KB
testcase_29 AC 167 ms
138,060 KB
testcase_30 AC 165 ms
138,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
if N == 1:
	exit(print(-1))
A = []
B = []
C = []
st = 0
if N % 3 == 2:
	A = [2, 4]
	B = [1, 6]
	C = [3, 5]
	st = 15
if N % 3 == 0:
	A = [1, 5, 9]
	B = [2, 6, 7]
	C = [3, 4, 8]
	st = 18
if N % 3 == 1:
	A = [1, 4, 7, 12]
	B = [2, 5, 8, 11]
	C = [3, 6, 9, 10]
	st = 21
for i in range(st, 3 * N + 1, 9):
	A += [i - 8, i - 4, i]
	B += [i - 7, i - 3, i - 2]
	C += [i - 6, i - 5, i - 1]
print(*(B + A + C))
0