結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー sgswsgsw
提出日時 2021-08-15 00:04:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 106,240 KB
最終ジャッジ日時 2024-04-15 21:56:41
合計ジャッジ時間 6,134 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,712 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 42 ms
51,840 KB
testcase_04 AC 43 ms
51,968 KB
testcase_05 WA -
testcase_06 AC 41 ms
51,968 KB
testcase_07 AC 40 ms
51,712 KB
testcase_08 WA -
testcase_09 AC 39 ms
51,712 KB
testcase_10 AC 39 ms
52,096 KB
testcase_11 AC 39 ms
51,968 KB
testcase_12 AC 39 ms
51,840 KB
testcase_13 AC 40 ms
52,096 KB
testcase_14 AC 41 ms
51,840 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 39 ms
52,224 KB
testcase_19 AC 40 ms
52,096 KB
testcase_20 AC 39 ms
51,840 KB
testcase_21 AC 39 ms
51,968 KB
testcase_22 AC 94 ms
101,504 KB
testcase_23 AC 52 ms
68,608 KB
testcase_24 AC 52 ms
67,072 KB
testcase_25 AC 96 ms
104,832 KB
testcase_26 AC 106 ms
101,968 KB
testcase_27 AC 92 ms
104,436 KB
testcase_28 AC 109 ms
101,980 KB
testcase_29 AC 61 ms
74,624 KB
testcase_30 AC 56 ms
70,016 KB
testcase_31 AC 108 ms
101,708 KB
testcase_32 AC 59 ms
73,112 KB
testcase_33 AC 47 ms
60,800 KB
testcase_34 AC 63 ms
76,672 KB
testcase_35 AC 95 ms
106,240 KB
testcase_36 AC 103 ms
96,340 KB
testcase_37 AC 56 ms
66,560 KB
testcase_38 AC 145 ms
103,448 KB
testcase_39 AC 46 ms
61,260 KB
testcase_40 AC 119 ms
102,912 KB
testcase_41 AC 71 ms
76,056 KB
testcase_42 AC 80 ms
80,000 KB
testcase_43 AC 50 ms
62,080 KB
testcase_44 AC 56 ms
65,792 KB
testcase_45 AC 146 ms
103,740 KB
testcase_46 AC 143 ms
103,040 KB
testcase_47 AC 145 ms
103,652 KB
testcase_48 AC 145 ms
103,132 KB
testcase_49 AC 147 ms
103,872 KB
testcase_50 AC 39 ms
51,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

'''
    Python3(PyPy3) Template for Programming-Contest.

    author : sgsw

    generated : 2021/08/14   
    when : 23:49:30

'''

import sys


def input():
    return sys.stdin.readline().rstrip()


DXY = [(0, -1), (1, 0), (0, 1), (-1, 0)]  # LDRU
mod = 998244353
inf = 1 << 64


def main():
    n = int(input())
    a = list(map(int,input().split()))
    if sorted(a) == a:
        print(0)
    else:
        #case 1
        b = [not a[i] <= a[i + 1] for i in range(n - 1)]
        if sum(b) == 1:
            print(1)
        else:
            print(2)
    return 0


if __name__ == "__main__":
    main()
0