結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-03 11:40:36 |
| 言語 | Ruby (3.4.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 201 bytes |
| コンパイル時間 | 113 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 25,344 KB |
| 最終ジャッジ日時 | 2024-09-19 17:21:06 |
| 合計ジャッジ時間 | 10,816 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 38 RE * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i
num = gets.split.map(&:to_i)
numary = []
num.each_with_index {|num, idx| numary << [num, idx] }
numary.sort!.reverse!
i = 0
i += 1 while (numary[i][1] > numary[i+1][1])
puts n - (i+1)