#54203: 為甚麼他說我輸出16行明明測試沒問題


supermax980614@gmail.com (哈密哈)


def checka(a,b,c,d,e,f):
       if a!=b and a==c and d!=e and d==f:
          return False
       else:
           return True
def checkb(a,b):
       if a==1 and b==0 :
           return False
       else:
           return True
def checkc(a,b,c,d,e,f):
       if a==b:
          return True
       if c==d:
          return True
       if e==f:
           return True
       else:
           return False


n=int(input())
dic={}
antirule=[]
for i in range(n*2):
     dic[i]=list(map(int,input().split()))
     i+=1
for m in range(0,n*2,2):
     if m<=n:
      
        if checka(dic[m][1],dic[m][3],dic[m][5],dic[m+1][1],dic[m+1][3],dic[m+1][5]):
            antirule.append("A")
        if checkb(dic[m][6],dic[m+1][6]):
            antirule.append("B")
        if checkc(dic[m][1],dic[m+1][1],dic[m][3],dic[m+1][3],dic[m][5],dic[m+1][5]):
            antirule.append("C")
        if len(antirule)==0:
           print("None")
        else:
            print(''.join(antirule))
            antirule=[]
        
     
         


     

 

#54213: Re: 為甚麼他說我輸出16行明明測試沒問題


pofly (不挖鼻孔有害身心健康)


因為你把後面的資料篩掉了,測試明明就很有問題

 

試試這個,我只是把範例測資全部合併成一個,改開頭的對聯數量,其他複製貼上

4
1 1 0 0 0 1 1
1 0 0 0 1 1 0
0 1 1 0 1 1 1
1 0 1 1 0 0 0
0 1 1 0 0 0 1
1 0 1 1 0 1 1
0 1 0 0 0 0 1
0 0 0 0 0 1 1

 

預期應輸出

AC
None
AB ABC

 

用你的版本去跑,只會顯示三組對聯的結果,因為最後一組被你篩掉了,直接跳過