結果

問題 No.1053 ゲーミング棒
ユーザー ああいいああいい
提出日時 2022-02-23 15:04:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 104,776 KB
最終ジャッジ日時 2023-09-14 07:19:53
合計ジャッジ時間 4,829 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,312 KB
testcase_01 WA -
testcase_02 AC 71 ms
71,232 KB
testcase_03 AC 72 ms
71,352 KB
testcase_04 AC 71 ms
71,188 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
71,104 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 72 ms
71,432 KB
testcase_12 AC 73 ms
71,276 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 72 ms
71,348 KB
testcase_16 WA -
testcase_17 AC 70 ms
71,224 KB
testcase_18 AC 71 ms
71,428 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 73 ms
71,412 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 111 ms
104,564 KB
testcase_26 AC 111 ms
104,580 KB
testcase_27 AC 72 ms
71,508 KB
testcase_28 WA -
testcase_29 AC 73 ms
71,432 KB
testcase_30 AC 93 ms
89,484 KB
testcase_31 AC 93 ms
89,232 KB
testcase_32 AC 92 ms
88,908 KB
testcase_33 AC 93 ms
89,228 KB
testcase_34 AC 93 ms
89,232 KB
testcase_35 AC 95 ms
89,664 KB
testcase_36 AC 95 ms
89,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N = int(input())
A = list(map(int,input().split()))
ans = 0
while A and A[-1] == A[0]:
    A.pop()
if not A:
    print(0)
    exit()
ans = 1
s =set()
left = 0
while left < len(A):
    if A[left] not in s:
        s.add(A[left])
        right = left
        while right < len(A) and A[right] == A[left]:
            right += 1
        left = right
    else:
        print(-1)
        exit()
print(ans)
0