結果

問題 No.1604 Swap Sort:ONE
ユーザー yuruhiyayuruhiya
提出日時 2021-07-17 10:58:30
言語 Crystal
(1.11.2)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 21,106 ms
コンパイル使用メモリ 252,760 KB
実行使用メモリ 5,560 KB
最終ジャッジ日時 2023-09-21 03:55:03
合計ジャッジ時間 21,573 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 2 ms
4,444 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 3 ms
4,428 KB
testcase_04 AC 2 ms
4,388 KB
testcase_05 AC 11 ms
5,484 KB
testcase_06 AC 12 ms
5,484 KB
testcase_07 AC 24 ms
5,348 KB
testcase_08 AC 24 ms
5,412 KB
testcase_09 AC 24 ms
5,408 KB
testcase_10 AC 25 ms
5,416 KB
testcase_11 AC 24 ms
5,424 KB
testcase_12 AC 24 ms
5,424 KB
testcase_13 AC 24 ms
5,448 KB
testcase_14 AC 24 ms
5,424 KB
testcase_15 AC 25 ms
5,424 KB
testcase_16 AC 24 ms
5,428 KB
testcase_17 AC 12 ms
5,504 KB
testcase_18 AC 11 ms
5,444 KB
testcase_19 AC 23 ms
5,416 KB
testcase_20 AC 11 ms
5,344 KB
testcase_21 AC 23 ms
5,500 KB
testcase_22 AC 18 ms
5,428 KB
testcase_23 AC 6 ms
5,216 KB
testcase_24 AC 4 ms
5,140 KB
testcase_25 AC 23 ms
5,560 KB
testcase_26 AC 13 ms
5,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = read_line.to_i
a = read_line.split.map(&.to_i)
puts a.each_with_index.sum { |x, i|
  a[i + 1..].count { |y| x > y }
}
0