結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-02-09 22:34:36 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 915 ms / 4,500 ms |
| コード長 | 254 bytes |
| コンパイル時間 | 37 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-06-27 02:30:31 |
| 合計ジャッジ時間 | 6,269 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
Main.rb:15: warning: `*' interpreted as 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