結果

問題 No.647 明太子
ユーザー cympfhcympfh
提出日時 2018-03-02 18:27:17
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,116 ms / 4,500 ms
コード長 266 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 11,460 KB
実行使用メモリ 71,828 KB
最終ジャッジ日時 2023-09-09 09:38:12
合計ジャッジ時間 6,441 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,088 KB
testcase_01 AC 76 ms
15,220 KB
testcase_02 AC 77 ms
15,152 KB
testcase_03 AC 78 ms
15,260 KB
testcase_04 AC 77 ms
15,048 KB
testcase_05 AC 77 ms
15,160 KB
testcase_06 AC 78 ms
15,156 KB
testcase_07 AC 78 ms
15,276 KB
testcase_08 AC 76 ms
15,024 KB
testcase_09 AC 90 ms
15,872 KB
testcase_10 AC 104 ms
17,144 KB
testcase_11 AC 85 ms
15,552 KB
testcase_12 AC 97 ms
16,596 KB
testcase_13 AC 118 ms
17,672 KB
testcase_14 AC 516 ms
24,264 KB
testcase_15 AC 139 ms
18,344 KB
testcase_16 AC 98 ms
16,468 KB
testcase_17 AC 634 ms
28,392 KB
testcase_18 AC 678 ms
28,776 KB
testcase_19 AC 279 ms
16,336 KB
testcase_20 AC 292 ms
16,676 KB
testcase_21 AC 155 ms
16,544 KB
testcase_22 AC 1,116 ms
71,828 KB
testcase_23 AC 79 ms
15,296 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
ab = n.times.map {gets.split.map(&:to_i)}
m = gets.to_i
r = m.times.map {|i|
  x, y = gets.split.map(&:to_i)
  c = ab.select{|a,b|x<=a&&y>=b}.size
  [i,c]
}
mx = r.map{|a|a[1]}.max
if mx.zero?
  p 0
else
  puts r.select{|a|a[1]==mx}.map{|a|a[0]+1}
end
0