結果

問題 No.2518 Adjacent Larger
ユーザー naesiranaesira
提出日時 2024-04-21 15:01:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 99,764 KB
最終ジャッジ日時 2024-04-21 15:01:10
合計ジャッジ時間 3,764 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,584 KB
testcase_01 AC 148 ms
77,824 KB
testcase_02 AC 160 ms
77,908 KB
testcase_03 AC 170 ms
76,344 KB
testcase_04 AC 150 ms
78,192 KB
testcase_05 AC 129 ms
76,372 KB
testcase_06 AC 96 ms
76,456 KB
testcase_07 AC 98 ms
76,416 KB
testcase_08 AC 95 ms
76,288 KB
testcase_09 AC 94 ms
76,628 KB
testcase_10 AC 94 ms
76,636 KB
testcase_11 AC 57 ms
69,376 KB
testcase_12 AC 56 ms
69,888 KB
testcase_13 AC 57 ms
69,504 KB
testcase_14 AC 65 ms
69,376 KB
testcase_15 AC 54 ms
69,120 KB
testcase_16 AC 79 ms
99,712 KB
testcase_17 AC 69 ms
81,704 KB
testcase_18 AC 65 ms
81,792 KB
testcase_19 AC 61 ms
78,288 KB
testcase_20 AC 72 ms
88,192 KB
testcase_21 AC 82 ms
98,760 KB
testcase_22 AC 75 ms
98,432 KB
testcase_23 AC 79 ms
99,584 KB
testcase_24 AC 77 ms
98,432 KB
testcase_25 AC 79 ms
99,712 KB
testcase_26 AC 75 ms
99,328 KB
testcase_27 AC 77 ms
99,764 KB
testcase_28 AC 78 ms
99,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(T := int(input())):
  N = int(input())
  A = list(map(int, input().split()))

  memo = 1
  for a in A*2:
    if a == 1:
      continue
    if a == memo:
      print("No")
      break
    memo = a
  else:
    print("No" if memo == 1 else "Yes")
0