打卡信奥刷题(339)用Scratch图形化工具信奥P4086[普及组/提高] [USACO17DEC] My Cow Ate My Homework S

[USACO17DEC] My Cow Ate My Homework S

题面翻译

在你的历史课上,你得到了一个很长的作业。这个作业包含了 N N N 个题目( 3 ≤ N ≤ 100 , 000 3 \le N \le 100,000 3N100,000),每个题目的成绩在 0 ∼ 10 , 000 0 \sim 10,000 010,000 之间。

按照惯例,你的老师按照以下方式计算最终成绩:去掉你最低的一个成绩,然后将其余成绩的平均成绩作为最终成绩。但不幸的是,你的宠物牛“贝西”刚刚吃了前 K K K 个题目的答案!( 1 ≤ K ≤ N − 2 1 \le K \le N-2 1KN2

经过你的一番解释,老师终于相信了你的故事,并且同意对你有答案的题目(没有被吃掉答案的题目)像之前一样给分——通过去掉最低的成绩(如果有多个最低成绩,则只去掉其中一个)并取剩余成绩的平均成绩。

根据这一成绩计算方案,请按升序输出所有可以使你最终成绩最高的 K K K 的值,相邻输出之间用换行隔开。

题目描述

In your bovine history class, you have been given a rather long homework assignment with N N N questions ( 3 ≤ N ≤ 100 , 000 3 \leq N \leq 100,000 3N100,000), each graded with an integer score in the range 0…10,000. As is often customary, your teacher plans to assign a final grade by discarding a question on which you received the lowest score and then averaging the remaining scores together. Unfortunately, your pet cow Bessie has just eaten your answers to the first K K K questions! ( K K K could be as small as 1 or as large as N − 2 N-2 N2).

After copious explanation, your teacher finally believes your story, and agrees to grade the remaining non-eaten part of the assignment the same way as before – by removing the lowest-scoring question (or one such question, in the event of a tie) and averaging the rest.

Please output all values of K K K which would have earned you the maximum possible score according to this grading scheme, in sorted order.

输入格式

The first line of input contains N N N, and the next line contains the scores on the N N N homework questions.

输出格式

Please output, one value per line, all values of K K K which would have earned you the maximum possible score.

样例 #1

样例输入 #1

5
3 1 9 2 7

样例输出 #1

2

提示

If Bessie eats the first two questions, then the remaining scores are 9, 2, and 7. Removing the minimum and averaging, we get a final grade of 8, which is the highest possible.

Scratch实现

在这里插入图片描述

后续

接下来我会不断用scratch来实现信奥比赛中的算法题、Scratch考级编程题实现、白名单赛事考题实现,感兴趣的请关注,我后续将继续分享相关内容

  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值