結果

問題 No.355 数当てゲーム(2)
ユーザー tnodino
提出日時 2022-06-14 17:59:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 549 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 28,120 KB
平均クエリ数 16.42
最終ジャッジ日時 2024-07-17 03:08:55
合計ジャッジ時間 6,587 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

def question(N):
    print(*N)
    return map(int,input().split())

s = []
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                l = [a, b, c, d]
                if len(set(l)) == 4:
                    s.append(l)
while True:
    h,b = question(s[0])
    if h == 4:
        break
    t = []
    for i in range(1,len(s)):
        cnt = 0
        for k in range(4):
            if s[i][k] in s[0]:
                cnt += 1
        if cnt == h + b:
            t.append(s[i])
    s = t
0