上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 54 下一页
  2023年12月31日
摘要: function<vector<int>(int,int) > dfs = [&](int x, int fa) -> vector<int> { vector<int> a = {cost[x]}; for (int y: g[x]) { if (y != fa) { auto res = dfs 阅读全文
posted @ 2023-12-31 16:43 towboat 阅读(51) 评论(0) 推荐(0)
  2023年12月23日
摘要: void inv(mat &x){ int n = 2, is[2], js[2]; memset(is, 0, sizeof(is)); memset(js, 0, sizeof(js)); for (int k = 0; k < n; k++) { for (int i = k, j; i < 阅读全文
posted @ 2023-12-23 00:26 towboat 阅读(22) 评论(0) 推荐(0)
  2023年12月17日
摘要: void init(int top){ inv[1] =1 ; for(int i=2;i<=top;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod; } 阅读全文
posted @ 2023-12-17 18:26 towboat 阅读(25) 评论(0) 推荐(0)
  2023年12月16日
摘要: 1 windows: https://www.cnblogs.com/zjh114/p/17650234.html 2 苹果的mac : 直接运行 https://zhuanlan.zhihu.com/p/103308900 调试 //cpp_.... { "configurations": [ { 阅读全文
posted @ 2023-12-16 00:07 towboat 阅读(26) 评论(0) 推荐(0)
  2023年12月6日
摘要: http://ica.openjudge.cn/function1/3/ const int N =1004; int n,m,f[N][N]; char a[N],b[N]; signed main(){ int i,j; cin>>a+1>>b+1; n=strlen(a+1); m=strle 阅读全文
posted @ 2023-12-06 11:37 towboat 阅读(31) 评论(0) 推荐(0)
  2023年11月22日
摘要: 跑n次 void dijk(){ for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) d[i][j]= inf; priority_queue<pii,vector<pii>,greater<pii> >q; for(int S=1;S<=n;S++){ q.pu 阅读全文
posted @ 2023-11-22 12:56 towboat 阅读(21) 评论(0) 推荐(0)
  2023年11月5日
摘要: vector<vector<double> > f(n + 1, vector<double>(n + 1)); 阅读全文
posted @ 2023-11-05 16:02 towboat 阅读(33) 评论(0) 推荐(0)
  2023年10月25日
摘要: 题目 https://www.luogu.com.cn/problem/AT_abc256_e 图论题,是个环套树 发现环上的边要取掉一条(min),其他的不用取 https://www.luogu.com.cn/record/131488937 阅读全文
posted @ 2023-10-25 13:01 towboat 阅读(16) 评论(0) 推荐(0)
  2023年10月23日
摘要: 给出 n 对点 ai ,bi ,在[1,m] 之间取一段区间。 当每一对点都有一个点在这个区间内时,这个区间合法。 求出不同长度的合法区间分别有多少个。 枚举 l, 右边r有个最小值R(l), 而 (l, j) j>r 之后的点都是合法点, 后面就是区间加,用差分维护 考虑这个 R (l) , 可以 阅读全文
posted @ 2023-10-23 22:21 towboat 阅读(41) 评论(0) 推荐(0)
  2023年10月20日
摘要: 基环树标记环上的点 https://www.luogu.com.cn/record/130531354 阅读全文
posted @ 2023-10-20 12:12 towboat 阅读(14) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 54 下一页