結果

問題 No.2518 Adjacent Larger
ユーザー hiro1729hiro1729
提出日時 2023-10-27 21:44:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 115,232 KB
最終ジャッジ日時 2023-10-27 21:44:39
合計ジャッジ時間 3,796 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,524 KB
testcase_01 AC 180 ms
77,876 KB
testcase_02 AC 188 ms
77,768 KB
testcase_03 AC 184 ms
78,412 KB
testcase_04 AC 179 ms
78,352 KB
testcase_05 AC 204 ms
78,500 KB
testcase_06 AC 105 ms
77,020 KB
testcase_07 AC 91 ms
76,144 KB
testcase_08 AC 98 ms
76,384 KB
testcase_09 AC 85 ms
76,152 KB
testcase_10 AC 92 ms
76,368 KB
testcase_11 AC 49 ms
72,632 KB
testcase_12 AC 48 ms
73,028 KB
testcase_13 AC 48 ms
72,624 KB
testcase_14 AC 49 ms
72,632 KB
testcase_15 AC 48 ms
72,624 KB
testcase_16 AC 77 ms
109,944 KB
testcase_17 AC 60 ms
89,712 KB
testcase_18 AC 61 ms
89,748 KB
testcase_19 AC 56 ms
84,544 KB
testcase_20 AC 78 ms
95,692 KB
testcase_21 AC 74 ms
107,432 KB
testcase_22 AC 73 ms
107,428 KB
testcase_23 AC 77 ms
110,164 KB
testcase_24 AC 62 ms
96,068 KB
testcase_25 AC 64 ms
96,188 KB
testcase_26 AC 63 ms
96,188 KB
testcase_27 AC 76 ms
114,224 KB
testcase_28 AC 80 ms
115,232 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) % len(b)] for i in range(len(b))) else "No")
0