結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー rlangevinrlangevin
提出日時 2023-10-25 20:43:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 111,772 KB
最終ジャッジ日時 2023-10-25 20:43:19
合計ジャッジ時間 10,680 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,336 KB
testcase_01 AC 37 ms
53,336 KB
testcase_02 AC 36 ms
53,336 KB
testcase_03 AC 36 ms
53,336 KB
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 40 ms
53,340 KB
testcase_08 AC 37 ms
53,340 KB
testcase_09 WA -
testcase_10 AC 36 ms
53,340 KB
testcase_11 AC 36 ms
53,340 KB
testcase_12 AC 36 ms
53,340 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 37 ms
53,340 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 103 ms
100,524 KB
testcase_23 AC 63 ms
82,336 KB
testcase_24 AC 57 ms
78,416 KB
testcase_25 AC 105 ms
102,980 KB
testcase_26 AC 120 ms
106,828 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 124 ms
97,280 KB
testcase_37 AC 67 ms
80,332 KB
testcase_38 AC 171 ms
110,660 KB
testcase_39 AC 50 ms
66,436 KB
testcase_40 AC 138 ms
100,072 KB
testcase_41 AC 83 ms
84,864 KB
testcase_42 AC 92 ms
87,304 KB
testcase_43 AC 53 ms
70,532 KB
testcase_44 AC 65 ms
79,832 KB
testcase_45 AC 171 ms
109,612 KB
testcase_46 AC 193 ms
109,128 KB
testcase_47 AC 175 ms
111,772 KB
testcase_48 AC 160 ms
107,064 KB
testcase_49 AC 162 ms
107,072 KB
testcase_50 AC 37 ms
53,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from copy import *

N = int(input())
A = list(map(int, input().split()))
D = sorted(deepcopy(A))
for i in range(N):
    if A[-1] == D[-1]:
        A.pop()
        D.pop()
        
if A == []:
    print(0)
    exit()
    
pre = A[0]
N = len(A)
L = [A[0]]
ans = []
for i in range(1, N):
    if A[i] >= pre:
        L.append(A[i])
    else:
        ans.append(L)
        L = [A[i]]
        
if L:
    ans.append(L)
    
if len(ans) > 2:
    print(2)
elif sorted(ans[1] + ans[0]) == sorted(A):
    print(1)
else:
    print(2)    
0