显然,这是一道模拟。
Obviously, this is an imitate question.
可是,这道题的题面有些坑。
Fyxj, there are a lot of tricks in the question.
我们不需要找到最优解,
Finding the best solution isn't our work,
我们只需要贪心地有券用券。
Else than using the tickets greedily.
运行,提交,AC,我很快就完成了这道题。
Run, Submit, Accepted, I finished this question quickly.
现在给上我的第一版代码。
My first edition of code is given now.
// Execute in 2023-09-21 20:31:30.
可是,它运行了 28ms。
However, it had run for 28ms.
考虑增加优化。
Addition of optimization be thought.
qqq 数组的长度太臭了,
Length of array qqq is too awful,
最后我们把它缩短至 100001100001100001。
Finally, we shorten it into 100001100001100001.
但是,这不能优化多少。
However, this can't optimize a lot.
嗯……对了,可以用快读!
Ummm... Yes, We can use "fast read"!
正常的快读是这样的:
Normal fast read is like this:
读数字是读整数中最耗时的一步。
Digit reading is the most time-consuming method in interger reading.
最近,我在 OI wiki 上看到了一种使用 fread() 的快读。
Recently, I saw a kind of fast reading which using fread().
把许多次读数字合并成一次是个好主意。
Unite a lot of digit readings into one time is a good idea.
当~这就是最终代码:(3ms, 2.51MB, 147147147 行)
Dang~This is the final code: (3ms, 2.51MB, 147147147 lines)
! 一举拿下最优解。
! It got the best solution.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
好了,你们猜我为什么会写英文?因为把所有加粗的字符(各段首字符)拼在一起,就是:
Offer me half hundred!
v 我 50!
FInished.