結果
| 問題 | No.355 数当てゲーム(2) | 
| コンテスト | |
| ユーザー |  ayaoni | 
| 提出日時 | 2020-12-30 20:50:42 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,474 bytes | 
| コンパイル時間 | 363 ms | 
| コンパイル使用メモリ | 82,020 KB | 
| 実行使用メモリ | 86,156 KB | 
| 平均クエリ数 | 6.77 | 
| 最終ジャッジ日時 | 2024-07-17 10:17:49 | 
| 合計ジャッジ時間 | 15,684 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 RE * 51 | 
ソースコード
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
print(count)
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,N4 = ANS
    print(N1,N2,N3,N4,flush=True)
    X,Y = MI()
    if X == 4:
        exit()
    if X+Y == 4:
        ANS += question
        break
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()
            
            
            
        