結果

問題 No.1053 ゲーミング棒
ユーザー kurimupykurimupy
提出日時 2020-06-12 22:30:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 22,328 KB
最終ジャッジ日時 2023-09-06 10:45:31
合計ジャッジ時間 2,578 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,252 KB
testcase_01 AC 17 ms
8,108 KB
testcase_02 AC 16 ms
8,100 KB
testcase_03 AC 16 ms
8,280 KB
testcase_04 AC 15 ms
8,096 KB
testcase_05 AC 16 ms
8,084 KB
testcase_06 AC 16 ms
8,092 KB
testcase_07 AC 16 ms
8,272 KB
testcase_08 AC 15 ms
8,268 KB
testcase_09 AC 15 ms
8,252 KB
testcase_10 AC 16 ms
8,096 KB
testcase_11 AC 15 ms
8,300 KB
testcase_12 AC 15 ms
8,112 KB
testcase_13 AC 16 ms
8,256 KB
testcase_14 AC 15 ms
8,228 KB
testcase_15 AC 15 ms
8,268 KB
testcase_16 AC 16 ms
8,100 KB
testcase_17 AC 16 ms
8,300 KB
testcase_18 AC 16 ms
8,220 KB
testcase_19 AC 16 ms
8,100 KB
testcase_20 AC 16 ms
8,260 KB
testcase_21 AC 16 ms
8,128 KB
testcase_22 AC 15 ms
8,272 KB
testcase_23 AC 74 ms
22,168 KB
testcase_24 AC 77 ms
22,204 KB
testcase_25 AC 76 ms
22,328 KB
testcase_26 AC 77 ms
22,244 KB
testcase_27 AC 16 ms
8,272 KB
testcase_28 AC 16 ms
8,264 KB
testcase_29 AC 15 ms
8,220 KB
testcase_30 AC 46 ms
10,084 KB
testcase_31 AC 46 ms
9,952 KB
testcase_32 AC 46 ms
9,956 KB
testcase_33 AC 46 ms
9,956 KB
testcase_34 AC 45 ms
10,092 KB
testcase_35 AC 52 ms
14,756 KB
testcase_36 AC 52 ms
15,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# problem 1
N = int(input())
K = list(map(int, input().split()))
d = []
d.append(K[0])
for i in range(1, N):
    if K[i] == d[-1]:
        pass
    else:
        d.append(K[i])
ALL = len(d)

# 施行は行われても一回までである

if d[0] == d[-1]:
    if len(d) == 1:
        print(0)
        exit()
    else:
        del d[0]
        if len(d) == len(set(d)):
            print(1)
        else:
            print(-1)
        exit()

else:
    if ALL == len(set(d)):
        print(0)
    else:
        print(-1)
    exit()
0