题解 | #小H学语文#

小H学语文

https://ac.nowcoder.com/acm/problem/281389

根据题意模拟即可

n = int(input())
l = [int(i) for i in input().split()]
l2 = []
index = 1
for i in l:
    l2.append((i,index))
    index += 1
l2.sort(key=lambda x:-x[0])
max1 = 0
schoice = None
for i in range(len(l2)):
    temp = (i+1)*(i+1)*l2[i][0]
    if temp > max1:
        max1 = temp
        schoice = i
l3 = []
for i in range(schoice+1):
    l3.append(l2[i][1])
l3.sort()
print(schoice+1)
print(' '.join(map(str,l3)))
全部评论

相关推荐

在看数据的傻狍子很忙碌:学生思维好重,而心很急,自己想想真的能直接做有难度的东西吗?任何错误都是需要人担责的,你实习生可以跑路,你的同事领导呢
点赞 评论 收藏
分享
秋盈丶:后续:我在宿舍群里和大学同学分享了这事儿,我好兄弟气不过把他挂到某脉上了,10w+阅读量几百条评论,直接干成精品贴子,爽
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务