QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 1024 MB Puntuación total: 100 Hackeable ✓

#18581. 获取学习资料

Estadísticas

$N$ 名学生想要去讲台领取学习资料。第 $i$ 号学生走到讲台需要 $t_i$ 秒,领取资料需要 $1$ 秒。注意,当某位学生正在领取资料时,其他学生无法领取资料。

忽略学生领取资料后回到座位的时间,请计算所有学生都领取完资料所需的最少时间(以秒为单位)。

输入格式

第一行给定学生人数 $N$。$(1\le N\le 1\,000)$

第二行给定 $N$ 个整数 $t_1, t_2, \dots, t_N$,表示每位学生走到讲台所需的时间,以空格分隔。$(1 \le t_i \le 10^5)$

输出格式

输出所有学生领取完资料所需的最少时间。

样例

输入 1

5
3 1 2 4 2

输出 1

6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.