QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 128 MB 总分: 100

#8083. KaChang!

统计

为算法竞赛题目设置时间限制是一项非常考验技巧的任务。如果时间限制设置得太紧,许多人会因为你对细节要求过于苛刻而责备你。另一方面,如果时间限制设置得太宽松,导致本不该通过的算法也能通过,那么同样会有许多人责备你。

在准备题目时,人们通常会将时间限制设置为标准程序运行时间的至少两倍,但有时参赛者仍然会觉得时间限制太紧。

现在你拥有一个问题的标准程序以及另外 $n$ 个被认为“应该通过该题”的程序。给定每个程序的运行时间,请找到最小的整数 $k \ge 2$,使得当时间限制设置为标准程序运行时间的 $k$ 倍时,所有提供的程序都能通过。一个程序能够通过当且仅当其运行时间小于或等于时间限制。

输入格式

第一行包含两个整数 $n, T$ ($1 \le n, T \le 10^5$),分别表示提供的程序数量(不包括标准程序)以及标准程序的运行时间。

第二行包含 $n$ 个整数 $t_1, t_2, \dots, t_n$ ($1 \le t_i \le 10^9$),表示各个程序的运行时间。

输出格式

输出一个大于或等于 $2$ 的整数,表示能保证所有提供的程序都能通过的最小 $k$ 值。

样例

样例输入 1

5 1000
998 244 353 1111 2333

样例输出 1

3

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.