結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー yuusanlondonyuusanlondon
提出日時 2021-03-12 22:56:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 113,128 KB
最終ジャッジ日時 2024-04-22 14:23:31
合計ジャッジ時間 5,068 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,352 KB
testcase_01 AC 38 ms
51,712 KB
testcase_02 AC 37 ms
51,584 KB
testcase_03 AC 38 ms
52,224 KB
testcase_04 AC 38 ms
51,968 KB
testcase_05 AC 38 ms
51,840 KB
testcase_06 AC 37 ms
52,352 KB
testcase_07 AC 37 ms
51,584 KB
testcase_08 AC 39 ms
51,840 KB
testcase_09 AC 38 ms
51,584 KB
testcase_10 AC 39 ms
51,968 KB
testcase_11 AC 38 ms
51,968 KB
testcase_12 AC 38 ms
51,968 KB
testcase_13 WA -
testcase_14 AC 38 ms
51,840 KB
testcase_15 AC 37 ms
51,968 KB
testcase_16 AC 37 ms
51,712 KB
testcase_17 AC 37 ms
51,712 KB
testcase_18 WA -
testcase_19 AC 37 ms
51,968 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 78 ms
97,280 KB
testcase_23 AC 50 ms
68,096 KB
testcase_24 AC 48 ms
67,072 KB
testcase_25 AC 79 ms
100,992 KB
testcase_26 AC 96 ms
101,888 KB
testcase_27 AC 100 ms
103,680 KB
testcase_28 AC 117 ms
112,748 KB
testcase_29 AC 67 ms
81,536 KB
testcase_30 AC 62 ms
75,776 KB
testcase_31 AC 115 ms
112,640 KB
testcase_32 AC 64 ms
78,848 KB
testcase_33 AC 50 ms
63,488 KB
testcase_34 AC 68 ms
83,712 KB
testcase_35 AC 102 ms
104,192 KB
testcase_36 AC 94 ms
106,880 KB
testcase_37 AC 56 ms
70,400 KB
testcase_38 AC 119 ms
112,708 KB
testcase_39 AC 51 ms
63,872 KB
testcase_40 AC 97 ms
101,240 KB
testcase_41 AC 67 ms
81,536 KB
testcase_42 AC 72 ms
86,144 KB
testcase_43 AC 52 ms
64,384 KB
testcase_44 AC 57 ms
69,248 KB
testcase_45 AC 119 ms
112,740 KB
testcase_46 AC 121 ms
113,128 KB
testcase_47 AC 121 ms
112,744 KB
testcase_48 AC 120 ms
112,752 KB
testcase_49 AC 120 ms
112,816 KB
testcase_50 AC 36 ms
51,840 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):
    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