Logo
(追記) (追記ここまで)

20739번 - Finn the Giant 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB61150.000%

문제

Frustrated by his legendary inability to tear down Lund's Cathedral, Finn the Giant wants to become better at destroying pillar-borne edifices. Together with his fellow trolls he has constructed a training site consisting of a colonnade of various pillars supporting a roof. The pillars differ in structural strength---some are hewn of Swedish granite, but in various styles, others are made of stone, clay, or even wood. The roof his a huge block of uniform granite. You can assume that in the beginning, each pillar is able to support its own part of the roof. The pillars have exactly the same distance.

As an experienced builder, Finns known enough structural engineering to understand how roof weight distributes across pillars: every pillar supports the part of the roof closest to it. After removing pillars 1 and 2, the middle pillar supports the shaded part of the roof:

At the left of pillar 0 and to the right of pillar $n-1,ドル the roof is supported by two indestructible pillars. Initially, every pillar is subject to the same pressure, 1000 kN.

Finn is able to tear down exactly one of the internal pillars, independent of its structural integrity. He hopes to start a chain reaction, whereby the redistribution of the roof's weights results in other pillars being crushed. Which pillar should Finn tear down to create the maximum damage?

입력

Input consists of two lines. On the first row, the number $n$ of pillars, with 1ドル\leq n\leq 100,000円$. On the second row, $n$ integers $b_0,ドル $\ldots,ドル $b_{n-1},ドル where 1ドル,000円 \leq b_i\leq 100,000円,000円,ドル representing how much each internal pillar can support (in kN), from left to right.

출력

A single line with two integers. First the maximal damage (counted in number of destroyed pillars) that Finn can cause. Second, the pillar he has to tear down. The internal pillars are numbered 0ドル,ドル 1ドル,ドル $\ldots,ドル $n-1$. If there are more than one correct answers, any will do.

제한

예제 입력 1

5
1341 2412 1200 3112 2391

예제 출력 1

3 1

예제 입력 2

5
1004 1003 1002 1001 1000

예제 출력 2

5 0

힌트

출처

Contest > Swedish Coding Cup > LTH Challenge 2020 E번

  • 문제를 만든 사람: Thore Husfeldt
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /