結果

問題 No.2518 Adjacent Larger
ユーザー hiro1729hiro1729
提出日時 2023-10-27 21:40:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 114,984 KB
最終ジャッジ日時 2023-10-27 21:40:08
合計ジャッジ時間 4,124 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,472 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 52 ms
72,544 KB
testcase_12 AC 52 ms
72,772 KB
testcase_13 AC 50 ms
72,540 KB
testcase_14 AC 51 ms
72,544 KB
testcase_15 AC 62 ms
72,540 KB
testcase_16 AC 82 ms
109,696 KB
testcase_17 AC 64 ms
89,620 KB
testcase_18 AC 63 ms
89,664 KB
testcase_19 AC 59 ms
84,460 KB
testcase_20 AC 70 ms
95,600 KB
testcase_21 AC 76 ms
107,404 KB
testcase_22 AC 75 ms
107,400 KB
testcase_23 AC 80 ms
109,916 KB
testcase_24 AC 67 ms
96,040 KB
testcase_25 AC 68 ms
96,160 KB
testcase_26 AC 65 ms
96,160 KB
testcase_27 AC 80 ms
114,140 KB
testcase_28 AC 82 ms
114,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in a:
		if i != 1:
			b.append(i)
	print("Yes" if 0 in b and 2 in b and all(b[i] != b[i + 1] for i in range(len(b) - 1)) else "No")
0