結果

問題 No.282 おもりと天秤(2)
コンテスト
ユーザー nebukuro09
提出日時 2016-10-20 01:41:43
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 1,323 ms / 5,000 ms
+ 19µs
コード長 541 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 57 ms
コンパイル使用メモリ 80,524 KB
実行使用メモリ 84,992 KB
平均クエリ数 1001.00
最終ジャッジ日時 2026-07-18 09:57:32
合計ジャッジ時間 16,692 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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(1000):
    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(map(str, A[:N]))
0