摘要: 同 泡泡堂 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; const int N=20005; int a[N],b[N],n; int solve(){ int ans=0; int s=1 阅读全文
posted @ 2021-10-06 01:23 dfydn 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 类似田忌赛马 首先这道题满足对称性:要想得到最差情况,只需求出对手的最优情况即可。 只考虑最优情况: 先不考虑相等情况: 如果当前最小大于对手最小,直接打掉,+2; 如果当前最大大于对手最大,直接打掉,+2; 否则用最小的换最大的,+0/+1。 考虑相等情况: 如果最大最小都相等,那么+1+1=+2 阅读全文
posted @ 2021-10-06 01:08 dfydn 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 按时长排序,在0时之前做的都在0时提交,0时之后的都直接提交,然后贪心做。 理解其正确性: 考虑对0时后罚时的理解:如果有没做出来的题,那么每一分钟都会对罚时有贡献,所以我们要使题的数量尽可能小,所以贪心是正确的。 #include<cstdio> #include<iostream> #inclu 阅读全文
posted @ 2021-10-06 00:37 dfydn 阅读(19) 评论(0) 推荐(0) 编辑