結果

問題 No.282 おもりと天秤(2)
ユーザー kurenaif
提出日時 2016-06-14 20:17:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,919 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 1,002 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 27,864 KB
平均クエリ数 220.83
最終ジャッジ日時 2024-07-16 23:58:09
合計ジャッジ時間 19,359 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math


def Q(nums):
    out = "? "
    for num in nums:
        out += str(num) + " "

    print(out[:len(out)-1])
    sys.stdout.flush()

def A(nums):
    out = "! "
    for num in nums:
        out += str(num) + " "

    print(out[:len(out)-1])
    sys.stdout.flush()

n = int(input())
n*=2
array = [0]*n
for i in range(int(n/2)):
    array[i] = i+1

for count in range(int(n/2)):
    off = ((count%2))
    Q(array[off:] + [0] if off == 1 else array)
    res = list(map(str, input().split()))
    for j in range(math.ceil(n/2.0)):
        if res[j] == ">" and array[2*j+1+off] != 0:
            array[2*j+off], array[2*j+1+off] = array[2*j+1+off], array[2*j+off]

A(array)
0