結果

問題 No.3234 Infinite Propagation
ユーザー timi
提出日時 2025-08-15 22:09:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 79,860 KB
最終ジャッジ日時 2025-08-15 22:10:23
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 12 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
  N=int(input())
  ans='No'
  c=0;A=[10**20];f=0
  for i in range(N):
    a,b=input().split()
    if ans=='No':
      if 'a' not in a and 'a' not in b:
        f=1
      if a=='a':
        if 'a' in b:
          ans='Yes'
        else:
          c=max(c,len(b))
      if a==len(a)*'b' and 'a' in b:
        A.append(len(a)) 
  if f==1:
    c=10**19
  if min(A)<=c:
    ans='Yes'
  print(ans)
        
      
        
          
      
0