結果

問題 No.282 おもりと天秤(2)
ユーザー vorg101vorg101
提出日時 2016-05-10 19:47:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 792 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 24,468 KB
平均クエリ数 334.33
最終ジャッジ日時 2023-09-23 10:35:28
合計ジャッジ時間 11,455 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
23,620 KB
testcase_01 WA -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
w = [i for i in range(1,N + 1)]
count = 0
while True:
    q = [0 for i in range(N * 2)]
    if count & 1 == 0:
        for i, n in enumerate(w):
            q[i] = n
    else:
        for i, n in enumerate(w[1:]):
            q[i] = n
    print('?', ' '.join(map(str, q)))
    C = input().split(' ')
    if count & 1 == 0 and not '>' in C:
       break
    if count & 1 == 0:
        for i, c in enumerate(C):
            if 2 * i + 1 >= N:
                break
            if c == '>':
                w[2 * i], w[2 * i + 1] = w[2 * i + 1], w[2 * i]
    else:
        for i in range(1, N):
            if 2 * i + 2 >= N:
                break
            if c == '>':
                w[2 * i + 1], w[2 * i + 2] = w[2 * i + 2], w[2 * i + 1]
print('!', ' '.join(map(str, w)))
0