摘要: 算出718207 #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(ll i=a;i>=b 阅读全文
posted @ 2020-11-13 18:32 Railgun000 阅读(341) 评论(0) 推荐(0) 编辑
摘要: 题目:http://codeforces.com/contest/1435/problem/D 要是当时看看这个D题就好了,血亏 简单的用栈模拟即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define 阅读全文
posted @ 2020-10-26 20:03 Railgun000 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目: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) 编辑
摘要: 题目:https://ac.nowcoder.com/acm/contest/7818/B 经典TSP问题,推荐看这篇文章:https://www.cnblogs.com/smashfun/p/11432110.html 模版: for (int i = 1; i <= n; i++) dp[1<< 阅读全文
posted @ 2020-10-03 21:21 Railgun000 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目:https://ac.nowcoder.com/acm/contest/7830/B n和m都很少,可以1e4次建图+dij暴力算期望 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 type 阅读全文
posted @ 2020-10-03 20:59 Railgun000 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 ll a[amn],tmpA[amn],cnt=0; 2 void merge_sort(ll l, ll r, ll *A) { 3 if (l >= r) return ; 4 int mid = (l + r) >> 1; 5 merge_sort(l, mid, A); 6 merge_ 阅读全文
posted @ 2020-09-30 20:11 Railgun000 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 typedef unsigned long long ull; 5 //typedef __int128_t LL; 6 typedef double 阅读全文
posted @ 2020-09-29 17:11 Railgun000 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Traveler ZOJ - 4103 The famous traveler BaoBao is visiting the Dream Kingdom now. There are nn cities in Dream Kingdom, numbered from 11 to nn. The ci 阅读全文
posted @ 2020-05-02 23:58 Railgun000 阅读(213) 评论(0) 推荐(0) 编辑