結果

問題 No.1425 Yet Another Cyclic Shifts Sorting
ユーザー convexineqconvexineq
提出日時 2021-03-13 00:07:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 108,800 KB
最終ジャッジ日時 2024-04-22 15:24:30
合計ジャッジ時間 5,706 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
52,096 KB
testcase_01 AC 42 ms
51,968 KB
testcase_02 AC 42 ms
51,712 KB
testcase_03 AC 41 ms
51,712 KB
testcase_04 AC 41 ms
52,224 KB
testcase_05 AC 41 ms
51,712 KB
testcase_06 AC 41 ms
52,224 KB
testcase_07 AC 42 ms
51,712 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 42 ms
51,456 KB
testcase_12 AC 41 ms
51,712 KB
testcase_13 AC 41 ms
52,096 KB
testcase_14 AC 42 ms
51,712 KB
testcase_15 WA -
testcase_16 AC 44 ms
51,584 KB
testcase_17 AC 45 ms
51,584 KB
testcase_18 AC 42 ms
51,712 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 41 ms
51,968 KB
testcase_22 AC 104 ms
105,088 KB
testcase_23 AC 61 ms
71,168 KB
testcase_24 AC 58 ms
68,864 KB
testcase_25 AC 112 ms
108,032 KB
testcase_26 AC 118 ms
107,044 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 90 ms
99,712 KB
testcase_37 AC 56 ms
66,048 KB
testcase_38 AC 119 ms
106,620 KB
testcase_39 AC 49 ms
60,416 KB
testcase_40 AC 107 ms
108,800 KB
testcase_41 AC 65 ms
76,672 KB
testcase_42 AC 70 ms
81,536 KB
testcase_43 AC 48 ms
61,312 KB
testcase_44 AC 54 ms
65,408 KB
testcase_45 AC 116 ms
106,732 KB
testcase_46 AC 118 ms
106,740 KB
testcase_47 AC 118 ms
106,736 KB
testcase_48 AC 118 ms
106,876 KB
testcase_49 AC 118 ms
106,612 KB
testcase_50 AC 40 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
v = 10**10
p = [0]*n
for i in range(n)[::-1]:
    if a[i] > v: break
    p[i] = 1
    v = a[i]
v = -1
q = [0]*n
for i in range(n):
    if a[i] < v: break
    q[i] = 1
    v = a[i]
idx = i
v = q[idx]
for i in range(idx,n):
    if a[i] < v: break
    q[i] = 1
    v = a[i]

L,R = q[0],q[idx-1]
ans = 2
for i in range(idx,n):
    if q[i-1] == p[i] == 1 and a[i-1] <= L and R <= a[i]:
        ans = 1

#print(p)
#print(idx,q)
if p[0] == 1:
    ans = 0
print(ans)
0