結果

問題 No.647 明太子
ユーザー maimai
提出日時 2018-02-09 22:32:59
言語 Ruby
(3.3.0)
結果
AC  
実行時間 860 ms / 4,500 ms
コード長 328 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 11,204 KB
実行使用メモリ 15,860 KB
最終ジャッジ日時 2023-09-09 09:22:20
合計ジャッジ時間 6,398 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,108 KB
testcase_01 AC 83 ms
15,256 KB
testcase_02 AC 82 ms
15,108 KB
testcase_03 AC 81 ms
15,240 KB
testcase_04 AC 81 ms
15,284 KB
testcase_05 AC 81 ms
15,132 KB
testcase_06 AC 81 ms
15,128 KB
testcase_07 AC 81 ms
15,108 KB
testcase_08 AC 81 ms
15,204 KB
testcase_09 AC 93 ms
15,248 KB
testcase_10 AC 100 ms
15,156 KB
testcase_11 AC 85 ms
15,024 KB
testcase_12 AC 96 ms
15,080 KB
testcase_13 AC 116 ms
15,312 KB
testcase_14 AC 469 ms
15,404 KB
testcase_15 AC 136 ms
15,160 KB
testcase_16 AC 96 ms
15,308 KB
testcase_17 AC 572 ms
15,468 KB
testcase_18 AC 612 ms
15,664 KB
testcase_19 AC 282 ms
15,684 KB
testcase_20 AC 292 ms
15,588 KB
testcase_21 AC 157 ms
15,352 KB
testcase_22 AC 860 ms
15,860 KB
testcase_23 AC 83 ms
15,292 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def ascan;gets.split.map(&:to_i);end

n=gets.to_i
users = (0...n).map{ascan}
m=gets.to_i
mentai = (0...m).map{ascan}

cnts = []
mentai.map! do |me|
    x,y = me
    cnts << users.count{|a,b| x<=a && b<=y}
end

max_cnts = cnts.max

if max_cnts == 0
    p 0
else
    m.times do |i|
        p i+1 if cnts[i] == max_cnts
    end
end
0