結果
問題 | No.1053 ゲーミング棒 |
ユーザー | ああいい |
提出日時 | 2022-02-23 15:04:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 401 bytes |
コンパイル時間 | 297 ms |
コンパイル使用メモリ | 86,984 KB |
実行使用メモリ | 104,580 KB |
最終ジャッジ日時 | 2023-09-14 07:19:19 |
合計ジャッジ時間 | 6,087 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 75 ms
71,280 KB |
testcase_03 | AC | 71 ms
71,120 KB |
testcase_04 | AC | 75 ms
70,960 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 69 ms
71,152 KB |
testcase_12 | AC | 73 ms
70,968 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 67 ms
71,124 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 69 ms
71,304 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 105 ms
104,408 KB |
testcase_27 | AC | 67 ms
71,064 KB |
testcase_28 | WA | - |
testcase_29 | AC | 67 ms
71,124 KB |
testcase_30 | AC | 86 ms
89,240 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | AC | 88 ms
88,996 KB |
testcase_34 | AC | 87 ms
88,884 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
ソースコード
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()