結果

問題 No.282 おもりと天秤(2)
ユーザー yaoshimaxyaoshimax
提出日時 2016-05-13 17:35:27
言語 PyPy2
(7.3.15)
結果
TLE  
実行時間 -
コード長 793 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 78,180 KB
実行使用メモリ 96,556 KB
平均クエリ数 123.42
最終ジャッジ日時 2023-09-23 10:37:35
合計ジャッジ時間 11,647 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
92,932 KB
testcase_01 AC 147 ms
95,144 KB
testcase_02 AC 119 ms
95,128 KB
testcase_03 AC 112 ms
94,932 KB
testcase_04 AC 107 ms
94,424 KB
testcase_05 AC 132 ms
94,984 KB
testcase_06 AC 154 ms
96,556 KB
testcase_07 AC 108 ms
94,736 KB
testcase_08 AC 154 ms
96,196 KB
testcase_09 AC 93 ms
92,956 KB
testcase_10 AC 2,891 ms
82,120 KB
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 #

import sys
N=int(raw_input())
ans=[]
used=[False for i in range(N+1)]
used[0]=True

for n in range(N):
    cand = [i for i in range(N+1) if used[i]==False]
    while len(cand)>=2:
        print '?',
        for c in cand:
            print c,
        for d in range(N*2-len(cand)):
            print 0,
        print
        sys.stdout.flush()
        ncand=[]
        res=raw_input().split()
        for i in range(0,len(cand),2):
            if i==len(cand)-1:
                ncand.append(cand[i])
            elif res[i/2]=='>':
                ncand.append(cand[i+1])
            elif res[i/2]=='<':
                ncand.append(cand[i])
        cand=ncand
    ans.append(cand[0])
    used[cand[0]]=True
print '!',
for a in ans:
    print a,
print
sys.stdout.flush()
    


            

0