結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2021-03-13 00:25:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 108,756 KB
最終ジャッジ日時 2024-04-22 15:41:45
合計ジャッジ時間 10,980 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,840 KB
testcase_01 AC 43 ms
52,096 KB
testcase_02 AC 42 ms
52,224 KB
testcase_03 AC 42 ms
51,840 KB
testcase_04 AC 43 ms
52,224 KB
testcase_05 AC 43 ms
52,352 KB
testcase_06 AC 42 ms
51,840 KB
testcase_07 AC 43 ms
52,096 KB
testcase_08 AC 43 ms
51,712 KB
testcase_09 AC 43 ms
52,352 KB
testcase_10 AC 43 ms
52,480 KB
testcase_11 AC 46 ms
51,840 KB
testcase_12 AC 43 ms
51,840 KB
testcase_13 WA -
testcase_14 AC 44 ms
51,840 KB
testcase_15 AC 42 ms
52,096 KB
testcase_16 AC 43 ms
52,224 KB
testcase_17 AC 43 ms
52,224 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 95 ms
100,480 KB
testcase_23 AC 60 ms
69,120 KB
testcase_24 AC 59 ms
67,712 KB
testcase_25 AC 99 ms
103,808 KB
testcase_26 AC 115 ms
102,704 KB
testcase_27 AC 109 ms
106,112 KB
testcase_28 AC 140 ms
105,012 KB
testcase_29 AC 79 ms
81,920 KB
testcase_30 AC 73 ms
76,800 KB
testcase_31 AC 142 ms
105,556 KB
testcase_32 AC 71 ms
75,904 KB
testcase_33 AC 55 ms
62,464 KB
testcase_34 AC 75 ms
80,000 KB
testcase_35 AC 129 ms
104,320 KB
testcase_36 AC 427 ms
101,888 KB
testcase_37 AC 121 ms
78,464 KB
testcase_38 AC 643 ms
108,212 KB
testcase_39 AC 64 ms
68,480 KB
testcase_40 AC 509 ms
104,064 KB
testcase_41 AC 213 ms
85,760 KB
testcase_42 AC 256 ms
89,344 KB
testcase_43 AC 81 ms
75,776 KB
testcase_44 AC 118 ms
77,952 KB
testcase_45 AC 642 ms
108,488 KB
testcase_46 AC 645 ms
107,976 KB
testcase_47 AC 656 ms
108,756 KB
testcase_48 AC 663 ms
108,104 KB
testcase_49 AC 659 ms
108,228 KB
testcase_50 AC 43 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin
import bisect

N = int(stdin.readline())
A = list(map(int,stdin.readline().split()))
B = [A[i] for i in range(N)]
B.sort()

while len(A) > 0 and B[-1] == A[-1]:
    del A[-1]
    del B[-1]

if len(A) == 0:
    print (0)
    sys.exit()

C = [ (A[i],i) for i in range(len(A)) ]
C.sort()

for i in range(len(A)-1):

    if C[i+1][1] != (C[i][1]+1) % len(C):
        print (2)
        sys.exit()

print (1)
0