結果

問題 No.282 おもりと天秤(2)
ユーザー yaoshimax
提出日時 2016-05-13 17:28:34
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 789 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 25,616 KB
平均クエリ数 79.79
最終ジャッジ日時 2024-07-16 10:08:40
合計ジャッジ時間 11,882 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 10 TLE * 1 -- * 12
権限があれば一括ダウンロードができます

ソースコード

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]=='>':
                ncand.append(cand[i+1])
            elif res[i]=='<':
                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