結果

問題 No.647 明太子
ユーザー letrangerjpletrangerjp
提出日時 2018-02-09 22:34:36
言語 Ruby
(3.3.0)
結果
AC  
実行時間 855 ms / 4,500 ms
コード長 254 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 15,884 KB
最終ジャッジ日時 2023-09-09 09:22:50
合計ジャッジ時間 6,062 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,028 KB
testcase_01 AC 80 ms
15,240 KB
testcase_02 AC 81 ms
15,016 KB
testcase_03 AC 81 ms
15,160 KB
testcase_04 AC 83 ms
15,180 KB
testcase_05 AC 82 ms
15,132 KB
testcase_06 AC 82 ms
15,136 KB
testcase_07 AC 83 ms
15,020 KB
testcase_08 AC 84 ms
15,132 KB
testcase_09 AC 94 ms
15,076 KB
testcase_10 AC 103 ms
15,112 KB
testcase_11 AC 88 ms
15,136 KB
testcase_12 AC 100 ms
15,164 KB
testcase_13 AC 117 ms
15,328 KB
testcase_14 AC 466 ms
15,452 KB
testcase_15 AC 137 ms
15,144 KB
testcase_16 AC 98 ms
15,236 KB
testcase_17 AC 568 ms
15,728 KB
testcase_18 AC 617 ms
15,524 KB
testcase_19 AC 281 ms
15,516 KB
testcase_20 AC 293 ms
15,448 KB
testcase_21 AC 159 ms
15,184 KB
testcase_22 AC 855 ms
15,884 KB
testcase_23 AC 84 ms
15,276 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:15: warning: `*' interpreted as argument prefix
Syntax OK

ソースコード

diff #

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
0