n = int(input())
a = []
pos = []
cnt = 0
mx_elem = -10000
for i in range(n):
x = int(input())
a.append(x)
if(a[i] > mx_elem):
pos.clear()
pos.append(i)
mx_elem = a[i]
cnt = 1
elif(a[i] == mx_elem):
cnt = cnt + 1
print(cnt)
for i in range(cnt):
print(pos[i], end = ' ')
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
n = int(input())
a = []
pos = []
cnt = 0
mx_elem = -10000
for i in range(n):
x = int(input())
a.append(x)
for i in range(n):
if(a[i] > mx_elem):
pos.clear()
pos.append(i)
mx_elem = a[i]
cnt = 1
elif(a[i] == mx_elem):
pos.append(i)
cnt = cnt + 1
print(cnt)
for i in range(cnt):
print(pos[i], end = ' ')