포럼
문제 ICPC00239

D. Daydreaming Stockbroker

설명

Gina Reed, the famous stockbroker, is having a slow day at work, and between rounds of solitaire she is daydreaming. Foretelling the future is hard, but imagine if you could just go back in time and use your knowledge of stock price history in order to maximize your profits!

Now Gina starts to wonder: if she were to go back in time a few days and bring a measly $\$100$ with her, how much money could she make by just buying and
selling stock in Rollercoaster Inc.~(the most volatile stock in
existence) at the right times? Would she earn enough to retire comfortably in a
mansion on Tenerife?

Note that Gina can not buy fractional shares, she must buy whole
shares in Rollercoaster Inc. The total number of shares in
Rollercoaster Inc.~is \(100\ 000\), so Gina can not own more than
\(100\ 000\) shares at any time. In Gina's daydream, the world is nice and simple: there are no fees for buying and selling stocks, stock prices change only once per day, and her trading does not influence the valuation of the stock.

제약
입력 형식

The first line of input contains an integer \(d\) (\(1 \le d \le 365\)), the number of days that Gina goes back in time in her daydream. Then follow \(d\) lines, the \(i\)'th of which contains an integer \(p_i\) (\(1 \le p_i \le 500\)) giving the price at which Gina can buy or sell stock in Rollercoaster Inc. on day \(i\). Days are ordered from oldest to newest.

출력 형식

Output the maximum possible amount of money Gina can have on the last day. Note that the answer may exceed \(2^{32}\).

예제 1
입력
6
100
200
100
150
125
300
출력
650
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2016

평가 및 의견

D. Daydreaming Stockbroker

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

D. Daydreaming Stockbroker

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8