結果
問題 |
No.282 おもりと天秤(2)
|
ユーザー |
|
提出日時 | 2016-10-20 01:39:23 |
言語 | Python2 (2.7.18) |
結果 |
RE
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 25,616 KB |
平均クエリ数 | 2.00 |
最終ジャッジ日時 | 2024-07-16 11:16:35 |
合計ジャッジ時間 | 6,436 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 24 |
ソースコード
import sys def ask(L): print '? ' + ' '.join(map(str, L)) sys.stdout.flush() return raw_input().split() N = int(raw_input()) A = range(1, N+1) + [0]*N for i in xrange(2): if i % 2 == 0: ans = ask(A) for j in xrange(N/2): if ans[j] == '>': A[j*2], A[j*2+1] = A[j*2+1], A[j*2] else: ans = ask(A[1:]+[0]) for j in xrange(N/2-1+N%2): if ans[j] == '>': A[j*2+1], A[j*2+2] = A[j*2+2], A[j*2+1] print '! ' + ' '.join(A[:N])