結果

問題 No.355 数当てゲーム(2)
ユーザー ayaoniayaoni
提出日時 2020-12-30 20:42:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,468 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 95,380 KB
平均クエリ数 12.60
最終ジャッジ日時 2023-09-24 09:32:40
合計ジャッジ時間 18,131 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 RE -
testcase_02 WA -
testcase_03 RE -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 RE -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 RE -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 RE -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 97 ms
86,768 KB
testcase_36 WA -
testcase_37 AC 97 ms
90,996 KB
testcase_38 RE -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 RE -
testcase_44 RE -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 RE -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


A = []
for i in range(5):
    print((4*i) % 10,(4*i+1) % 10,(4*i+2) % 10,(4*i+3) % 10,flush=True)
    X,Y = MI()
    if X == 4:
        exit()
    A.append(X+Y)

count = [0,0,0,0,0]
count[0] = A[0]+A[1]+A[2]-4
count[1] = A[3]+A[4]+A[0]-4
count[2] = A[1]+A[2]+A[3]-4
count[3] = A[4]+A[0]+A[1]-4
count[4] = A[2]+A[3]+A[4]-4

ANS = []
B = []
for i in range(5):
    if count[i] == 2:
        ANS.append(2*i)
        ANS.append(2*i+1)
    elif count[i] == 1:
        B.append((2*i,2*i+1))

l = len(B)
for i in range(2**l):
    question = []
    for j in range(l):
        question.append(B[j][(i>>j) % 1])
    if l == 4:
        N1,N2,N3,N4 = question
    else:
        N1,N2 = question
        N3 = ANS[0]
        N4 = ANS[1]
    print(N1,N2,N3,N4,flush=True)
    X,Y = MI()
    if X == 4:
        exit()
    if X+Y == 4:
        ANS += question

for ans in list(permutations(ANS,4)):
    N1,N2,N3,N4 = ans
    print(N1,N2,N3,N4,flush=True)
    X,Y = MI()
    if X == 4:
        exit()
0