結果
| 問題 | 
                            No.2518 Adjacent Larger
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-10-27 22:17:53 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 281 bytes | 
| コンパイル時間 | 197 ms | 
| コンパイル使用メモリ | 82,284 KB | 
| 実行使用メモリ | 105,152 KB | 
| 最終ジャッジ日時 | 2024-09-25 14:20:35 | 
| 合計ジャッジ時間 | 3,318 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 1 | 
| other | RE * 28 | 
ソースコード
t=int(input())
for _ in range(t):
	n=int(input())
	A=list(map(int,input().split()))
	if set(A)=={1}:
		print("No")
		continue
		p=1
	for i in A:
		if i==2:
			if p==2:
				print("No")
				continue
			p=2
		if i==0:
			if p==0:
				print("No")
				continue
			p=0
	print("Yes")