結果

問題 No.1053 ゲーミング棒
ユーザー Kiri8128Kiri8128
提出日時 2020-05-15 21:32:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,760 KB
実行使用メモリ 75,112 KB
最終ジャッジ日時 2023-10-19 13:08:44
合計ジャッジ時間 2,937 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,400 KB
testcase_01 AC 39 ms
53,400 KB
testcase_02 AC 39 ms
53,400 KB
testcase_03 WA -
testcase_04 AC 39 ms
53,400 KB
testcase_05 WA -
testcase_06 AC 40 ms
53,400 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 39 ms
53,400 KB
testcase_12 AC 39 ms
53,400 KB
testcase_13 WA -
testcase_14 AC 39 ms
53,400 KB
testcase_15 AC 39 ms
53,400 KB
testcase_16 AC 40 ms
53,400 KB
testcase_17 AC 39 ms
53,400 KB
testcase_18 AC 38 ms
53,400 KB
testcase_19 AC 39 ms
53,400 KB
testcase_20 AC 40 ms
53,400 KB
testcase_21 AC 39 ms
53,400 KB
testcase_22 WA -
testcase_23 AC 59 ms
75,104 KB
testcase_24 AC 60 ms
75,112 KB
testcase_25 AC 59 ms
75,112 KB
testcase_26 AC 59 ms
75,112 KB
testcase_27 WA -
testcase_28 AC 38 ms
53,400 KB
testcase_29 AC 38 ms
53,400 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 55 ms
71,964 KB
testcase_34 AC 55 ms
71,964 KB
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [int(a) - 1 for a in input().split()]
X = [0] * N
for i, a in enumerate(A):
    if X[a]:
        if X[A[i-1]] == a:
            continue
        else:
            if a != A[0]:
                print(-1)
                exit()
            for j in range(i+1, N):
                if A[j] != a:
                    print(-1)
                    exit()
            print(1)
            exit()
    else:
        X[a] = 1
    
print(0)
0