結果

問題 No.24 数当てゲーム
ユーザー rocoderrocoder
提出日時 2017-05-09 05:47:12
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 839 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,260 KB
最終ジャッジ日時 2023-10-12 20:03:46
合計ジャッジ時間 962 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,048 KB
testcase_01 AC 15 ms
7,896 KB
testcase_02 AC 16 ms
7,884 KB
testcase_03 AC 15 ms
8,260 KB
testcase_04 AC 16 ms
8,172 KB
testcase_05 AC 15 ms
8,144 KB
testcase_06 AC 15 ms
7,824 KB
testcase_07 AC 16 ms
8,096 KB
testcase_08 AC 15 ms
8,156 KB
testcase_09 AC 16 ms
8,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
i=0
A=[]
for i in range(N):
    A.append(input().split())
    i+=1
y=0
i=0
K=["0","1","2","3","4","5","6","7","8","9"]
while y==0 and i<N:
    if A[i][4]=="YES":
        K=A[i][:-1]
   #     print (K)
        y=1
    i=i+1
if i==N:
    i=0
while len(K)>1:
    if i==N-1:
        i=0
    else:
        i+=1
    j=0
    while len(K)>1 and j<len(K):
        m=0
        ex=0
        while ex==0 and m<4:
      #      print(K[j])
  #          print (i)
            if K[j]==A[i][m]:
  #              print(A[i][m])
                if A[i][4]=="NO":
                    K.pop(j)
                    j-=1
                ex=1
            else:
                m+=1
        if ex==0:
            if A[i][4]=="YES":
                K.pop(j)
                j-=1
      #          print(j)      
        j+=1
  #  print(K)
print(K[0])
0