Hatena::Grouptopcoder

TopCoderの問題を解く

解いた問題の一覧表

2009-05-05

BigBurger

| 18:40

問題文

451.11->498.43 / 500

ハンバーガ店で、一番待たなければならない客の待ち時間を求めよ、という問題。

class BigBurger {
public:
    int maxWait(vector <int> arrival, vector <int> service) {
        int maxWaitTime = 0;
        int time = arrival[0] + service[0];
        for (int i = 1; i < arrival.size(); i++) {
            time = max(time, arrival[i]);
            maxWaitTime = max(maxWaitTime, time-arrival[i]);
            time += service[i];
        }
        return maxWaitTime;
    }
};

EthanaelEthanael2011/07/22 23:14Ppl like you get all the brains. I just get to say thanks for he asewnr.

nwuzwsnwuzws2011/07/23 17:24hyvJcw <a href="http://snkjtvdtsudq.com/">snkjtvdtsudq</a>

tumzkdcbtumzkdcb2011/07/23 22:087LifN6 , [url=http://qcpqtmgyqoyx.com/]qcpqtmgyqoyx[/url], [link=http://aubgoopyvcjc.com/]aubgoopyvcjc[/link], http://wsyiiftrtiox.com/

jijaysgrhiqjijaysgrhiq2011/07/25 21:508QsglD <a href="http://gpbtdukulkdq.com/">gpbtdukulkdq</a>