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

33333번 - Average Value 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB138382530.120%

문제

You are given an array $a$ of $n$ integers. Find any index $i$ (1ドル \le i \le n$) such that the element $a_i$ equals to the geometric mean of all the other elements. In other words, find any index $i$ that satisfies the following formula: $$ a_i = \root{n-1}\of{\prod_{\substack{k=1 \\ k \neq i}}^n a_k}\text{.} $$

입력

The first line contains one integer $n$ (2ドル \leq n \leq 10^5$): the length of the array.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($a_k \geq 1$; the total number of digits in all numbers does not exceed 300ドル,000円$).

It is guaranteed that the answer exists for the given array.

출력

Output one integer: the index of the element that equals to geometric mean of the others items. It there are several answers, output any one of them.

제한

예제 입력 1

5
2 4 8 16 32

예제 출력 1

3

예제 입력 2

2
123456789012345678901234567890 123456789012345678901234567890

예제 출력 2

2

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 2: Nyatl Contest 2023 A번

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

출처

대학교 대회

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

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