5.5 比赛总结
主编:yqx34
制作人员:yqx34、yyq3、Starlight_Footprint
5.5 比赛总结
0 赛后感
emm……
难爆了!
比之前两次都难……
1 草坪
评价:顶级·橙
考点:数学(Maths)
考试题目链接
标准题目链接
一道特判题??(没错制作人员们(包括主编)都没想到)
首先,读完题,发现实际(而且样例也是)只要ceil(n / k)就可以,可你交上去,WA。
代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
double n,k;
cin >> n >> k;
cout << ceil(n / k) << "\n";
return 0;
}
(一条不那么美丽的分割线)
其实原因很简单,但又难想到——当
因为题目“此外,已知在完成所述操作整整一小时后,该区域的草会重新生长出来。”,所以草还没长出来,不能修剪,答案是原来的答案加
综合代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
double n,k,ans;
cin >> n >> k;
ans = ceil(n / k);
if (n < 2 * k && n != k) ans++;
cout << ans << "\n";
return 0;
}
2 闹钟
评级:夯爆了·黄
考点:二分(Binary Search) & 双指针(Two-Pointer)
考试题目链接
标准题目链接
一道想出思路可写了一半发现不会写的题。。。。。。