結果

問題 No.647 明太子
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-03-31 10:14:41
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,468 ms / 4,500 ms
コード長 307 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 11,144 KB
実行使用メモリ 85,200 KB
最終ジャッジ日時 2023-09-06 05:52:30
合計ジャッジ時間 8,547 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
14,992 KB
testcase_01 AC 71 ms
15,188 KB
testcase_02 AC 73 ms
15,140 KB
testcase_03 AC 71 ms
15,256 KB
testcase_04 AC 78 ms
15,096 KB
testcase_05 AC 72 ms
15,252 KB
testcase_06 AC 72 ms
15,252 KB
testcase_07 AC 74 ms
15,132 KB
testcase_08 AC 75 ms
15,144 KB
testcase_09 AC 86 ms
16,940 KB
testcase_10 AC 105 ms
19,080 KB
testcase_11 AC 78 ms
16,080 KB
testcase_12 AC 99 ms
17,764 KB
testcase_13 AC 130 ms
21,188 KB
testcase_14 AC 711 ms
31,436 KB
testcase_15 AC 164 ms
22,060 KB
testcase_16 AC 99 ms
18,004 KB
testcase_17 AC 862 ms
52,796 KB
testcase_18 AC 938 ms
58,788 KB
testcase_19 AC 397 ms
38,308 KB
testcase_20 AC 432 ms
41,400 KB
testcase_21 AC 209 ms
25,328 KB
testcase_22 AC 1,468 ms
85,200 KB
testcase_23 AC 75 ms
15,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=Array.new(n)
b=Array.new(n)
n.times{|i|a[i],b[i]=gets.split.map &:to_i}
m=gets.to_i
x=Array.new(m)
y=Array.new(m)
m.times{|j|x[j],y[j]=gets.split.map &:to_i}
z=(0...m).map{|j|[j,(0...n).map{|i|x[j]<=a[i]&&y[j]>=b[i]?1:0}.sum]}.group_by{|k,v|v}.max_by{|k,v|k}
z[0]>0?z[1].map{|k,v|p k+1}:(p 0)
0