結果
| 問題 |
No.610 区間賞(Section Award)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-29 10:38:02 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 364 ms / 2,000 ms |
| コード長 | 409 bytes |
| コンパイル時間 | 224 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 33,408 KB |
| 最終ジャッジ日時 | 2024-12-21 10:25:13 |
| 合計ジャッジ時間 | 11,291 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
コンパイルメッセージ
Main.rb:9: warning: assigned but unused variable - s Syntax OK
ソースコード
N = $stdin.gets.chomp.to_i
place = (0...N).map{ |i| [i+1,0,0] }
$stdin.gets.chomp.split(" ").map{ |a| a.to_i }.each_with_index{ |s,i| place[s-1][1] = i+1 }
$stdin.gets.chomp.split(" ").map{ |a| a.to_i }.each_with_index{ |g,i| place[g-1][2] = i+1 }
g_min = N+1
ans = []
place.sort_by{ |e| e[1] }.reverse.each { |e|
n,s,g = *e
if g <= g_min
ans << n
end
g_min = [g_min, g].min
}
puts ans.sort