結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 39 ms
52,096 KB
testcase_02 AC 37 ms
51,840 KB
testcase_03 AC 38 ms
51,968 KB
testcase_04 WA -
testcase_05 AC 39 ms
51,584 KB
testcase_06 AC 38 ms
52,096 KB
testcase_07 AC 38 ms
52,096 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 39 ms
51,712 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 39 ms
51,840 KB
testcase_15 WA -
testcase_16 AC 39 ms
52,096 KB
testcase_17 AC 40 ms
51,968 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 97 ms
105,088 KB
testcase_23 AC 52 ms
70,528 KB
testcase_24 AC 49 ms
69,248 KB
testcase_25 AC 100 ms
107,848 KB
testcase_26 AC 105 ms
106,228 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 79 ms
99,328 KB
testcase_37 AC 46 ms
66,560 KB
testcase_38 AC 103 ms
106,584 KB
testcase_39 AC 41 ms
59,776 KB
testcase_40 AC 95 ms
108,728 KB
testcase_41 AC 56 ms
77,056 KB
testcase_42 AC 60 ms
81,536 KB
testcase_43 AC 42 ms
61,568 KB
testcase_44 AC 46 ms
65,920 KB
testcase_45 AC 104 ms
106,488 KB
testcase_46 AC 106 ms
106,616 KB
testcase_47 AC 106 ms
106,828 KB
testcase_48 AC 106 ms
106,880 KB
testcase_49 AC 107 ms
107,308 KB
testcase_50 AC 36 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(i)

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




0