結果

問題 No.282 おもりと天秤(2)
ユーザー kimiyukikimiyuki
提出日時 2016-06-14 18:31:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 910 ms / 5,000 ms
コード長 534 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 11,000 KB
実行使用メモリ 24,596 KB
平均クエリ数 211.21
最終ジャッジ日時 2023-09-24 00:07:03
合計ジャッジ時間 9,402 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
23,696 KB
testcase_01 AC 43 ms
24,264 KB
testcase_02 AC 40 ms
23,420 KB
testcase_03 AC 40 ms
24,024 KB
testcase_04 AC 39 ms
23,592 KB
testcase_05 AC 41 ms
23,988 KB
testcase_06 AC 43 ms
23,768 KB
testcase_07 AC 38 ms
23,752 KB
testcase_08 AC 46 ms
23,400 KB
testcase_09 AC 37 ms
23,580 KB
testcase_10 AC 208 ms
24,132 KB
testcase_11 AC 677 ms
24,296 KB
testcase_12 AC 217 ms
23,832 KB
testcase_13 AC 309 ms
24,596 KB
testcase_14 AC 670 ms
24,088 KB
testcase_15 AC 626 ms
24,452 KB
testcase_16 AC 75 ms
24,508 KB
testcase_17 AC 321 ms
24,076 KB
testcase_18 AC 484 ms
24,068 KB
testcase_19 AC 451 ms
24,428 KB
testcase_20 AC 760 ms
24,144 KB
testcase_21 AC 910 ms
24,072 KB
testcase_22 AC 689 ms
24,024 KB
testcase_23 AC 39 ms
23,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
QUERY_LIMIT = 2000
n = int(input())
a = list(range(1,n+1))
for i in range(QUERY_LIMIT):
    q = []
    j = i % 2
    while j+1 < n:
        q += [a[j], a[j+1]]
        j += 2
    while len(q)//2 < n:
        q += [0, 0]
    print('?', *q)
    sys.stdout.flush()
    q = input().split()
    j = i % 2
    modified = False
    while j+1 < n:
        if q[j//2] == '>':
            a[j], a[j+1] = a[j+1], a[j]
            modified = True
        j += 2
    if not modified:
        break
print('!', *a)
0