結果

問題 No.647 明太子
ユーザー nonokai10nonokai10
提出日時 2018-03-27 14:43:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,696 ms / 4,500 ms
コード長 371 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 15,892 KB
最終ジャッジ日時 2023-09-09 09:43:49
合計ジャッジ時間 7,926 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,160 KB
testcase_01 AC 80 ms
15,032 KB
testcase_02 AC 79 ms
15,108 KB
testcase_03 AC 80 ms
15,332 KB
testcase_04 AC 80 ms
15,300 KB
testcase_05 AC 80 ms
15,068 KB
testcase_06 AC 79 ms
15,264 KB
testcase_07 AC 79 ms
15,048 KB
testcase_08 AC 79 ms
15,036 KB
testcase_09 AC 95 ms
15,072 KB
testcase_10 AC 113 ms
15,248 KB
testcase_11 AC 86 ms
15,264 KB
testcase_12 AC 104 ms
15,244 KB
testcase_13 AC 136 ms
15,180 KB
testcase_14 AC 706 ms
15,720 KB
testcase_15 AC 167 ms
15,244 KB
testcase_16 AC 102 ms
15,136 KB
testcase_17 AC 863 ms
15,732 KB
testcase_18 AC 937 ms
15,728 KB
testcase_19 AC 363 ms
15,796 KB
testcase_20 AC 381 ms
15,668 KB
testcase_21 AC 191 ms
15,356 KB
testcase_22 AC 1,696 ms
15,892 KB
testcase_23 AC 81 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = []
gets.to_i.times do
  a << gets.split.map(&:to_i)
end
m = []
gets.to_i.times do
  m << gets.split.map(&:to_i)
end
count = Array.new(m.size, 0)
a.each do |i|
  m.each_with_index do |j,k|
    count[k] += 1 if j[0] <= i[0] && j[1] >= i[1]
  end
end
if count.all?{|i| i == 0}
  p 0
else
  max = count.max
  count.each_with_index do |i,j|
    p j+1 if i == max
  end
end
0