摘要: 题目:http://codeforces.com/contest/1418/problem/A 设需要a次1操作,则等式为 1+a*(x-1)=tot=k+k*y, a次1操作得到足够的s,再进行k次2操作,所以答案是a+k 化简为: 这里需要用到向上取整公式 #include<bits/stdc+ 阅读全文
posted @ 2020-10-14 19:22 Railgun000 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 题目:http://codeforces.com/contest/1419/problem/D2 本来写的是easy version的代码,交hard version竟然能过 #include<bits/stdc++.h> using namespace std; typedef long long 阅读全文
posted @ 2020-10-14 18:17 Railgun000 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 注意搜到终点就不要搜了,不然会TLE #include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,a,b) for(ll i=a;i<=b;i++) #define per(i,a,b) for(l 阅读全文
posted @ 2020-10-14 16:06 Railgun000 阅读(84) 评论(0) 推荐(0) 编辑