結果

問題 No.365 ジェンガソート
ユーザー matsukin1111matsukin1111
提出日時 2018-12-13 10:01:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 26,404 KB
最終ジャッジ日時 2023-10-25 09:06:11
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,100 KB
testcase_01 AC 29 ms
10,100 KB
testcase_02 AC 29 ms
10,100 KB
testcase_03 AC 29 ms
10,100 KB
testcase_04 AC 29 ms
10,100 KB
testcase_05 AC 28 ms
10,100 KB
testcase_06 AC 29 ms
10,100 KB
testcase_07 AC 29 ms
10,100 KB
testcase_08 AC 29 ms
10,100 KB
testcase_09 AC 29 ms
10,100 KB
testcase_10 AC 29 ms
10,100 KB
testcase_11 AC 30 ms
10,100 KB
testcase_12 AC 29 ms
10,100 KB
testcase_13 AC 30 ms
10,100 KB
testcase_14 AC 29 ms
10,100 KB
testcase_15 AC 30 ms
10,104 KB
testcase_16 AC 158 ms
19,724 KB
testcase_17 AC 155 ms
25,164 KB
testcase_18 AC 38 ms
11,504 KB
testcase_19 AC 133 ms
26,172 KB
testcase_20 AC 56 ms
15,972 KB
testcase_21 AC 63 ms
14,756 KB
testcase_22 AC 158 ms
19,980 KB
testcase_23 AC 102 ms
18,400 KB
testcase_24 AC 149 ms
19,936 KB
testcase_25 AC 61 ms
13,376 KB
testcase_26 AC 125 ms
18,468 KB
testcase_27 AC 206 ms
25,592 KB
testcase_28 AC 127 ms
19,552 KB
testcase_29 AC 187 ms
25,156 KB
testcase_30 AC 127 ms
19,520 KB
testcase_31 AC 69 ms
15,016 KB
testcase_32 AC 66 ms
14,924 KB
testcase_33 AC 201 ms
26,404 KB
testcase_34 AC 53 ms
12,884 KB
testcase_35 AC 150 ms
19,856 KB
testcase_36 AC 115 ms
26,136 KB
testcase_37 AC 145 ms
26,136 KB
testcase_38 AC 207 ms
26,136 KB
testcase_39 AC 130 ms
26,136 KB
testcase_40 AC 136 ms
26,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
s = list(map(int,input().split()))
t = {}
ss = sorted(s)
ss.reverse()
num = 0
p = 0
for a,b in enumerate(s):
    t[b] = a

for i in range(len(ss)-1):
    if t[ss[i+1]] > t[ss[i]]:
        t[ss[i+1]] = p-1
        p -= 1
        num += 1

print(num)
0