結果

問題 No.282 おもりと天秤(2)
ユーザー ayame_pyayame_py
提出日時 2015-10-14 05:36:33
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,764 ms / 5,000 ms
コード長 582 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 6,640 KB
実行使用メモリ 24,372 KB
平均クエリ数 212.21
最終ジャッジ日時 2023-09-23 21:53:24
合計ジャッジ時間 16,529 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
24,276 KB
testcase_01 AC 36 ms
23,364 KB
testcase_02 AC 34 ms
23,508 KB
testcase_03 AC 34 ms
23,352 KB
testcase_04 AC 37 ms
23,508 KB
testcase_05 AC 38 ms
23,616 KB
testcase_06 AC 41 ms
23,400 KB
testcase_07 AC 35 ms
23,628 KB
testcase_08 AC 38 ms
23,412 KB
testcase_09 AC 33 ms
23,832 KB
testcase_10 AC 440 ms
23,808 KB
testcase_11 AC 1,402 ms
23,400 KB
testcase_12 AC 472 ms
24,300 KB
testcase_13 AC 726 ms
23,508 KB
testcase_14 AC 1,248 ms
24,324 KB
testcase_15 AC 1,452 ms
24,372 KB
testcase_16 AC 105 ms
23,616 KB
testcase_17 AC 655 ms
24,012 KB
testcase_18 AC 1,079 ms
24,024 KB
testcase_19 AC 1,125 ms
23,520 KB
testcase_20 AC 1,619 ms
23,616 KB
testcase_21 AC 1,641 ms
23,400 KB
testcase_22 AC 1,764 ms
23,616 KB
testcase_23 AC 34 ms
23,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
N=int(raw_input())
ans = [i+1 for i in range(N)]
z = [0 for i in range(1500)]
z=' '.join(map(str,z))
e=0
for i in range(N*2):
	l=i%2
	r=l+int((N-l)/2)*2
	q=' '.join(map(str, ans[l:r]))

	if (r-l)!=0:
		q=q[0:r*4]+' '+z[0:(N-(N-l)/2)*4]
	else:
		q=z[0:(N-(N-l)/2)*4]
	print '? '+q[0:len(q)-1]
	sys.stdout.flush()
	ret = raw_input().split()
	f=True
	for j in range((N-l)/2):
		if ret[j]=='>':
			f=False
			ans[j*2+i%2],ans[j*2+i%2+1]=ans[j*2+i%2+1],ans[j*2+i%2]
	if f:e+=1
	else:e=0
	if e==2:break

ans=' '.join(map(str, ans))
print '! '+ans
sys.stdout.flush()
sys.exit()
0