結果

問題 No.2518 Adjacent Larger
ユーザー akebono03akebono03
提出日時 2023-10-27 22:50:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 164 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 1,288 ms
コンパイル使用メモリ 81,448 KB
実行使用メモリ 113,528 KB
最終ジャッジ日時 2023-10-27 22:50:16
合計ジャッジ時間 3,984 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
55,416 KB
testcase_01 AC 151 ms
77,140 KB
testcase_02 AC 138 ms
77,200 KB
testcase_03 AC 140 ms
77,200 KB
testcase_04 AC 137 ms
76,912 KB
testcase_05 AC 164 ms
77,176 KB
testcase_06 AC 90 ms
76,472 KB
testcase_07 AC 94 ms
76,452 KB
testcase_08 AC 99 ms
76,372 KB
testcase_09 AC 85 ms
76,452 KB
testcase_10 AC 90 ms
76,460 KB
testcase_11 AC 48 ms
72,136 KB
testcase_12 AC 47 ms
72,992 KB
testcase_13 AC 47 ms
71,924 KB
testcase_14 AC 46 ms
71,964 KB
testcase_15 AC 47 ms
71,992 KB
testcase_16 AC 75 ms
109,064 KB
testcase_17 AC 59 ms
89,008 KB
testcase_18 AC 59 ms
89,048 KB
testcase_19 AC 77 ms
83,844 KB
testcase_20 AC 65 ms
97,036 KB
testcase_21 AC 76 ms
109,116 KB
testcase_22 AC 75 ms
109,112 KB
testcase_23 AC 77 ms
109,128 KB
testcase_24 AC 66 ms
97,744 KB
testcase_25 AC 81 ms
97,864 KB
testcase_26 AC 66 ms
97,864 KB
testcase_27 AC 76 ms
113,528 KB
testcase_28 AC 77 ms
113,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
    B = []
    for a in A:
        if a == 1:
            continue
        B.append(a)
    if len(B) == 0:
        print('No')
        return
    # B.append(B[0])
    # print(B)
    for i in range(len(B)):
        if B[i-1] == B[i]:
            print('No')
            return
    print('Yes')
for _ in range(T):
    solve()
0