結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー yuusanlondonyuusanlondon
提出日時 2021-03-12 23:02:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 113,000 KB
最終ジャッジ日時 2024-04-22 14:30:06
合計ジャッジ時間 5,343 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,968 KB
testcase_01 AC 45 ms
52,096 KB
testcase_02 AC 41 ms
51,712 KB
testcase_03 AC 41 ms
52,096 KB
testcase_04 AC 41 ms
51,712 KB
testcase_05 AC 40 ms
51,712 KB
testcase_06 AC 40 ms
51,712 KB
testcase_07 AC 40 ms
51,968 KB
testcase_08 AC 41 ms
52,096 KB
testcase_09 AC 41 ms
51,840 KB
testcase_10 AC 40 ms
51,968 KB
testcase_11 AC 41 ms
51,712 KB
testcase_12 AC 40 ms
51,584 KB
testcase_13 WA -
testcase_14 AC 40 ms
51,968 KB
testcase_15 AC 40 ms
51,584 KB
testcase_16 AC 41 ms
51,968 KB
testcase_17 AC 41 ms
51,840 KB
testcase_18 AC 41 ms
52,096 KB
testcase_19 AC 41 ms
51,840 KB
testcase_20 AC 41 ms
51,584 KB
testcase_21 AC 40 ms
51,840 KB
testcase_22 AC 87 ms
97,152 KB
testcase_23 AC 56 ms
68,480 KB
testcase_24 AC 54 ms
66,688 KB
testcase_25 AC 91 ms
100,992 KB
testcase_26 AC 106 ms
101,760 KB
testcase_27 AC 112 ms
104,064 KB
testcase_28 AC 126 ms
113,000 KB
testcase_29 AC 75 ms
81,024 KB
testcase_30 AC 69 ms
75,520 KB
testcase_31 AC 126 ms
112,384 KB
testcase_32 AC 72 ms
78,592 KB
testcase_33 AC 56 ms
63,616 KB
testcase_34 AC 77 ms
83,712 KB
testcase_35 AC 113 ms
104,576 KB
testcase_36 AC 105 ms
107,136 KB
testcase_37 AC 65 ms
70,272 KB
testcase_38 AC 130 ms
112,452 KB
testcase_39 AC 57 ms
63,616 KB
testcase_40 AC 111 ms
100,992 KB
testcase_41 AC 76 ms
81,408 KB
testcase_42 AC 80 ms
86,144 KB
testcase_43 AC 57 ms
65,024 KB
testcase_44 AC 63 ms
69,632 KB
testcase_45 AC 129 ms
112,636 KB
testcase_46 AC 128 ms
112,748 KB
testcase_47 AC 129 ms
112,876 KB
testcase_48 AC 129 ms
112,880 KB
testcase_49 AC 127 ms
112,748 KB
testcase_50 AC 44 ms
51,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
flag=0
for i in range(n-1):
    if a[i+1]<a[i]:
        flag=1
if not flag:
    print(0)
    exit()
k=min(a)
b=[]
for i in range(n-1,-1,-1):
    if a[i]==k:
        j=i+1
        b=[a[i]]
        while j<n and a[j]<=a[0]:
            b.append(a[j])
            j+=1
        for k in range(i):
            b.append(a[k])
        for k in range(j,n):
            b.append(a[k])
        break
flag=0
for i in range(n-1):
    if b[i+1]<b[i]:
        flag=1
if not flag:
    print(1)
    exit() 
print(2)
0