結果

問題 No.282 おもりと天秤(2)
ユーザー yaoshimaxyaoshimax
提出日時 2016-05-13 17:28:34
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 789 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 6,700 KB
実行使用メモリ 32,044 KB
平均クエリ数 79.79
最終ジャッジ日時 2023-09-23 10:37:16
合計ジャッジ時間 11,905 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
24,264 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 TLE -
testcase_12 WA -
testcase_13 WA -
testcase_14 TLE -
testcase_15 TLE -
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]=='>':
                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