結果
問題 |
No.2518 Adjacent Larger
|
ユーザー |
|
提出日時 | 2023-10-27 22:37:45 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 498 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 82,604 KB |
実行使用メモリ | 102,148 KB |
最終ジャッジ日時 | 2024-09-25 14:40:18 |
合計ジャッジ時間 | 3,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 14 WA * 14 |
ソースコード
def ip():return int(input()) def mp():return map(int, input().split()) def lmp():return list(map(int, input().split())) T = ip() from collections import defaultdict def solve(): N = ip() A = lmp() cnt = defaultdict(int) for i in range(N): cnt[A[i]] += 1 if A[i] != 1 and A[i] == A[i-1]: print('No') return if cnt[0] == 0 or cnt[2] == 0 or cnt[0] != cnt[2]: print('No') else: print('Yes') for _ in range(T): solve()