結果
| 問題 | No.2518 Adjacent Larger |
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2023-10-27 22:38:07 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 330 bytes |
| 記録 | |
| コンパイル時間 | 250 ms |
| コンパイル使用メモリ | 81,516 KB |
| 実行使用メモリ | 103,920 KB |
| 最終ジャッジ日時 | 2024-09-25 14:40:37 |
| 合計ジャッジ時間 | 4,072 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 14 |
ソースコード
import collections
T = int(input())
for _ in range(T):
N = int(input())
A = list(map(int, input().split()))
C = collections.Counter(A)
ans = C[0]==C[2] and C[1]<N
for i in range(N):
if A[i]==A[i-1] and A[i]!=1:
ans = False
if ans:
print('Yes')
else:
print('No')
H20