結果

問題 No.355 数当てゲーム(2)
ユーザー 👑 KazunKazun
提出日時 2021-03-12 01:47:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 626 bytes
コンパイル時間 264 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 94,500 KB
平均クエリ数 5.52
最終ジャッジ日時 2023-09-24 02:53:02
合計ジャッジ時間 9,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
93,664 KB
testcase_01 AC 121 ms
93,512 KB
testcase_02 AC 123 ms
94,072 KB
testcase_03 AC 116 ms
93,440 KB
testcase_04 AC 121 ms
93,652 KB
testcase_05 AC 125 ms
93,512 KB
testcase_06 AC 116 ms
93,564 KB
testcase_07 AC 121 ms
94,128 KB
testcase_08 AC 115 ms
93,392 KB
testcase_09 AC 119 ms
93,904 KB
testcase_10 AC 115 ms
93,504 KB
testcase_11 AC 118 ms
93,600 KB
testcase_12 AC 120 ms
93,516 KB
testcase_13 AC 115 ms
93,972 KB
testcase_14 AC 117 ms
94,500 KB
testcase_15 AC 115 ms
93,468 KB
testcase_16 AC 119 ms
93,948 KB
testcase_17 AC 120 ms
94,188 KB
testcase_18 AC 121 ms
93,792 KB
testcase_19 AC 121 ms
94,240 KB
testcase_20 AC 115 ms
93,676 KB
testcase_21 AC 116 ms
93,888 KB
testcase_22 AC 115 ms
93,688 KB
testcase_23 AC 118 ms
93,644 KB
testcase_24 AC 127 ms
93,336 KB
testcase_25 AC 128 ms
93,568 KB
testcase_26 AC 117 ms
94,064 KB
testcase_27 AC 118 ms
93,416 KB
testcase_28 AC 115 ms
93,660 KB
testcase_29 AC 116 ms
93,684 KB
testcase_30 AC 122 ms
93,652 KB
testcase_31 AC 118 ms
93,624 KB
testcase_32 AC 117 ms
93,924 KB
testcase_33 AC 119 ms
93,848 KB
testcase_34 AC 117 ms
93,548 KB
testcase_35 AC 86 ms
91,216 KB
testcase_36 AC 115 ms
94,132 KB
testcase_37 AC 131 ms
93,560 KB
testcase_38 AC 128 ms
94,136 KB
testcase_39 AC 118 ms
93,808 KB
testcase_40 AC 119 ms
93,480 KB
testcase_41 AC 121 ms
93,948 KB
testcase_42 AC 118 ms
94,064 KB
testcase_43 AC 116 ms
93,584 KB
testcase_44 AC 118 ms
93,912 KB
testcase_45 AC 117 ms
93,932 KB
testcase_46 AC 117 ms
94,012 KB
testcase_47 AC 112 ms
93,900 KB
testcase_48 AC 119 ms
93,744 KB
testcase_49 AC 122 ms
93,684 KB
testcase_50 AC 128 ms
93,584 KB
testcase_51 AC 111 ms
93,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def quest(t):
    print(*t,flush=True)
    p,q=map(int,input().split())
    if p==4:
        exit()
    return p,q

def eat_bite(s,t):
    eat=bite=0
    for i in range(4):
        if s[i] in t:
            if s[i]==t[i]:
                eat+=1
            else:
                bite+=1
    return eat,bite

from itertools import permutations

X=[a+b+c+d for a,b,c,d in permutations("0123456789",r=4)]
X_len=len(X)
F=[1]*(X_len)

while True:
    for i in range(X_len):
        if F[i]:
            r=quest(X[i])
            break

    F[i]=0
    for j in range(i+1,X_len):
        if r!=eat_bite(X[i],X[j]):
            F[j]=0
0