結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,088 KB
testcase_01 AC 29 ms
10,088 KB
testcase_02 AC 29 ms
10,088 KB
testcase_03 AC 29 ms
10,088 KB
testcase_04 AC 29 ms
10,088 KB
testcase_05 AC 28 ms
10,088 KB
testcase_06 AC 28 ms
10,088 KB
testcase_07 AC 28 ms
10,088 KB
testcase_08 AC 28 ms
10,088 KB
testcase_09 AC 29 ms
10,088 KB
testcase_10 AC 29 ms
10,088 KB
testcase_11 AC 28 ms
10,088 KB
testcase_12 AC 29 ms
10,088 KB
testcase_13 AC 29 ms
10,088 KB
testcase_14 AC 28 ms
10,088 KB
testcase_15 AC 29 ms
10,092 KB
testcase_16 AC 162 ms
19,712 KB
testcase_17 AC 157 ms
25,152 KB
testcase_18 AC 37 ms
11,492 KB
testcase_19 AC 132 ms
26,160 KB
testcase_20 AC 54 ms
15,960 KB
testcase_21 AC 66 ms
14,744 KB
testcase_22 AC 160 ms
19,968 KB
testcase_23 AC 103 ms
18,388 KB
testcase_24 AC 153 ms
19,924 KB
testcase_25 AC 60 ms
13,364 KB
testcase_26 AC 123 ms
18,456 KB
testcase_27 AC 199 ms
25,580 KB
testcase_28 AC 124 ms
19,540 KB
testcase_29 AC 185 ms
25,144 KB
testcase_30 AC 133 ms
19,508 KB
testcase_31 AC 70 ms
15,004 KB
testcase_32 AC 71 ms
14,912 KB
testcase_33 AC 208 ms
26,392 KB
testcase_34 AC 53 ms
12,872 KB
testcase_35 AC 149 ms
19,844 KB
testcase_36 AC 113 ms
26,124 KB
testcase_37 AC 145 ms
26,124 KB
testcase_38 AC 211 ms
26,124 KB
testcase_39 AC 130 ms
26,124 KB
testcase_40 AC 137 ms
26,124 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