結果

問題 No.397 NO MORE KADOMATSU
ユーザー cielciel
提出日時 2016-07-16 00:19:57
言語 Ruby
(3.3.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 11,284 KB
実行使用メモリ 31,776 KB
平均クエリ数 651.67
最終ジャッジ日時 2023-09-24 00:19:25
合計ジャッジ時間 3,215 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
30,864 KB
testcase_01 AC 94 ms
30,784 KB
testcase_02 AC 97 ms
30,868 KB
testcase_03 AC 100 ms
30,760 KB
testcase_04 AC 92 ms
30,660 KB
testcase_05 AC 94 ms
31,228 KB
testcase_06 AC 98 ms
30,760 KB
testcase_07 AC 95 ms
31,016 KB
testcase_08 AC 94 ms
30,704 KB
testcase_09 AC 94 ms
31,116 KB
testcase_10 AC 122 ms
31,776 KB
testcase_11 AC 94 ms
30,760 KB
testcase_12 AC 97 ms
31,448 KB
testcase_13 AC 107 ms
31,148 KB
testcase_14 AC 107 ms
30,808 KB
testcase_15 AC 110 ms
30,888 KB
testcase_16 AC 94 ms
30,960 KB
testcase_17 AC 97 ms
30,596 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,*a=(gets+gets).split.map(&:to_i);z=[];n.times{|i|(i+1...n).each{|j|if a[i]>a[j];z<<[i,j];a[i],a[j]=a[j],a[i] end}};p z.size;z.each{|e|puts e*' '}
0