結果
| 問題 | No.647 明太子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-09 22:34:36 |
| 言語 | Ruby (4.0.1) |
| 結果 |
AC
|
| 実行時間 | 577 ms / 4,500 ms |
| コード長 | 254 bytes |
| 記録 | |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 15,104 KB |
| 最終ジャッジ日時 | 2026-03-14 05:14:13 |
| 合計ジャッジ時間 | 4,430 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
Main.rb:15: warning: ambiguous `*` has been interpreted as an argument prefix Syntax OK
ソースコード
N = gets.to_i
AB = N.times.map{gets.split.map &:to_i}
M = gets.to_i
XY = M.times.map{gets.split.map &:to_i}
a = XY.map{|x,y|
AB.count{|a,b|
x<=a&&y>=b
}
}
max = a.max
if max == 0
p 0
else
p *a.map.with_index(1){|n, i|n==max ? i : p}-[p]
end