結果

問題 No.1604 Swap Sort:ONE
ユーザー KudeKude
提出日時 2021-07-16 21:28:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 165 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 77,620 KB
最終ジャッジ日時 2023-09-20 13:01:05
合計ジャッジ時間 5,754 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,292 KB
testcase_01 AC 77 ms
71,280 KB
testcase_02 AC 74 ms
71,604 KB
testcase_03 AC 79 ms
71,396 KB
testcase_04 AC 75 ms
71,396 KB
testcase_05 AC 129 ms
77,144 KB
testcase_06 AC 128 ms
77,320 KB
testcase_07 AC 189 ms
77,384 KB
testcase_08 AC 187 ms
77,516 KB
testcase_09 AC 182 ms
77,380 KB
testcase_10 AC 188 ms
77,268 KB
testcase_11 AC 181 ms
77,480 KB
testcase_12 AC 211 ms
77,504 KB
testcase_13 AC 190 ms
77,232 KB
testcase_14 AC 186 ms
77,232 KB
testcase_15 AC 190 ms
77,580 KB
testcase_16 AC 186 ms
77,512 KB
testcase_17 AC 127 ms
77,428 KB
testcase_18 AC 128 ms
77,472 KB
testcase_19 AC 178 ms
77,504 KB
testcase_20 AC 123 ms
77,480 KB
testcase_21 AC 177 ms
77,436 KB
testcase_22 AC 154 ms
77,488 KB
testcase_23 AC 99 ms
77,004 KB
testcase_24 AC 92 ms
76,648 KB
testcase_25 AC 180 ms
77,408 KB
testcase_26 AC 138 ms
77,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
p = [0] * n
for i, x in enumerate(map(int, input().split())):
    p[x - 1] = i
ans = sum(p[j] > p[i] for i in range(n) for j in range(i))
print(ans)
0