A1015 | Acowdemia--Silver
来源USACO
时间限制1s
内存限制128MB
通过 / 提交0/0
题目描述
Bessie the cow has enrolled in a computer science PhD program, driven by her
love of computer science and also the allure of one day becoming "Dr. Bessie".
Having worked for some time on her academic research, she has now published
$N$ papers ($1 \leq N \leq 10^5$), and her $i$-th paper has accumulated $c_i$
citations ($0 \leq c_i \leq 10^5$) from other papers in the research
literature.
Bessie has heard that an academic's success can be measured by their
$h$-index. The $h$-index is the largest number $h$ such that the researcher
has at least $h$ papers each with at least $h$ citations. For example, a
researcher with $4$ papers and respective citation counts $(1,100,2,3)$ has an
$h$-index of $2$, whereas if the citation counts were $(1,100,3,3)$ then the
$h$-index would be $3$.
To up her $h$-index, Bessie is planning to write up to $K$ survey articles ($0
\leq K \leq 10^5$), each citing many of her past papers. However, due to page
limits, she can only cite at most $L$ papers in each survey ($0 \leq L \leq
10^5$). Of course, no paper may be cited multiple times in a single survey
(but a paper may be cited in several surveys).
Help Bessie determine the maximum $h$-index she may achieve after writing
these survey articles. Bessie is not allowed to cite a survey from one of her
surveys.
Note that Bessie's research advisor should probably inform her at some point
that writing a survey solely to increase one's $h$ index is ethically dubious;
other academics are not recommended to follow Bessie's example here.
love of computer science and also the allure of one day becoming "Dr. Bessie".
Having worked for some time on her academic research, she has now published
$N$ papers ($1 \leq N \leq 10^5$), and her $i$-th paper has accumulated $c_i$
citations ($0 \leq c_i \leq 10^5$) from other papers in the research
literature.
Bessie has heard that an academic's success can be measured by their
$h$-index. The $h$-index is the largest number $h$ such that the researcher
has at least $h$ papers each with at least $h$ citations. For example, a
researcher with $4$ papers and respective citation counts $(1,100,2,3)$ has an
$h$-index of $2$, whereas if the citation counts were $(1,100,3,3)$ then the
$h$-index would be $3$.
To up her $h$-index, Bessie is planning to write up to $K$ survey articles ($0
\leq K \leq 10^5$), each citing many of her past papers. However, due to page
limits, she can only cite at most $L$ papers in each survey ($0 \leq L \leq
10^5$). Of course, no paper may be cited multiple times in a single survey
(but a paper may be cited in several surveys).
Help Bessie determine the maximum $h$-index she may achieve after writing
these survey articles. Bessie is not allowed to cite a survey from one of her
surveys.
Note that Bessie's research advisor should probably inform her at some point
that writing a survey solely to increase one's $h$ index is ethically dubious;
other academics are not recommended to follow Bessie's example here.
输入格式
The first line contains $N$, $K$, and $L$.
The second line contains $N$ space-separated integers $c_1,\ldots, c_N$.
The second line contains $N$ space-separated integers $c_1,\ldots, c_N$.
输出格式
The maximum $h$-index on a single line.
输入输出样例
输入 #1
4 4 1 1 100 1 1
输出 #1
3
In this example, Bessie may write up to $4$ survey articles, each citing at
most $1$ paper. If she cites each of her first and third articles twice, then
her $h$-index becomes $3$.
most $1$ paper. If she cites each of her first and third articles twice, then
her $h$-index becomes $3$.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted