結果

問題 No.365 ジェンガソート
ユーザー _matumo__matumo_
提出日時 2019-04-24 00:23:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 20,820 KB
最終ジャッジ日時 2024-04-24 03:20:56
合計ジャッジ時間 5,158 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 25 ms
10,624 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 27 ms
10,624 KB
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 25 ms
10,752 KB
testcase_08 AC 26 ms
10,624 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 25 ms
10,752 KB
testcase_12 AC 25 ms
10,624 KB
testcase_13 AC 26 ms
10,752 KB
testcase_14 AC 25 ms
10,624 KB
testcase_15 AC 26 ms
10,752 KB
testcase_16 AC 132 ms
18,404 KB
testcase_17 AC 146 ms
20,060 KB
testcase_18 AC 37 ms
11,520 KB
testcase_19 AC 133 ms
19,904 KB
testcase_20 AC 61 ms
13,608 KB
testcase_21 AC 61 ms
13,056 KB
testcase_22 AC 137 ms
18,192 KB
testcase_23 AC 93 ms
15,292 KB
testcase_24 AC 127 ms
17,748 KB
testcase_25 AC 56 ms
12,672 KB
testcase_26 AC 102 ms
16,052 KB
testcase_27 AC 171 ms
20,488 KB
testcase_28 AC 109 ms
16,288 KB
testcase_29 AC 159 ms
19,068 KB
testcase_30 AC 113 ms
16,536 KB
testcase_31 AC 68 ms
13,312 KB
testcase_32 AC 65 ms
13,184 KB
testcase_33 AC 165 ms
20,820 KB
testcase_34 AC 49 ms
12,288 KB
testcase_35 AC 130 ms
17,924 KB
testcase_36 AC 135 ms
20,540 KB
testcase_37 AC 167 ms
20,516 KB
testcase_38 AC 166 ms
20,528 KB
testcase_39 AC 152 ms
20,644 KB
testcase_40 AC 156 ms
20,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
pa = [int(s) for s in input().split()]
pb = [0]*(N+1)
for i in range(N):
    pb[i+1] = max(pb[i], pa[i])
n = 0
for i in range(N-1, -1, -1):
    if pa[i] < pb[i] or pa[i] < pb[0]:
        pb[0] = max(pb[0], pa[i])
        n += 1
print(n)
0