Official

B - 祭日の来客 / Festival Visitors: The Busiest Day Editorial by harurun4635 Editorial for printing


\(A\) の最大値 \(\displaystyle M = \max_{1 \le i \le N}(A)\) を求めたあと、 \(A_i = M\) であるような最小の \(i\) を求めれば良いです。

くふうとして、 \((-A_i, i)\) の最小値を求めても良いです。


実装例

n = int(input())
a = list(map(int, input().split()))
a = [(-a[i],i+1) for i in range(n)]
a.sort()
print(a[0][1])

posted:
last update: