結果

問題 No.282 おもりと天秤(2)
ユーザー kurenaifkurenaif
提出日時 2016-06-14 20:17:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,606 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 24,688 KB
平均クエリ数 220.83
最終ジャッジ日時 2023-09-24 00:07:44
合計ジャッジ時間 15,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
24,140 KB
testcase_01 AC 38 ms
23,792 KB
testcase_02 AC 35 ms
23,740 KB
testcase_03 AC 38 ms
23,868 KB
testcase_04 AC 35 ms
23,744 KB
testcase_05 AC 36 ms
23,996 KB
testcase_06 AC 41 ms
23,736 KB
testcase_07 AC 34 ms
24,376 KB
testcase_08 AC 40 ms
24,220 KB
testcase_09 AC 32 ms
24,080 KB
testcase_10 AC 408 ms
24,332 KB
testcase_11 AC 1,448 ms
24,292 KB
testcase_12 AC 451 ms
24,192 KB
testcase_13 AC 710 ms
24,644 KB
testcase_14 AC 1,218 ms
24,464 KB
testcase_15 AC 1,511 ms
24,656 KB
testcase_16 AC 105 ms
23,788 KB
testcase_17 AC 657 ms
24,584 KB
testcase_18 AC 1,042 ms
24,688 KB
testcase_19 AC 1,093 ms
24,144 KB
testcase_20 AC 1,606 ms
24,616 KB
testcase_21 AC 1,534 ms
24,096 KB
testcase_22 AC 1,556 ms
24,684 KB
testcase_23 AC 33 ms
24,440 KB
権限があれば一括ダウンロードができます

ソースコード

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