随笔 - 530  文章 - 0  评论 - 3  阅读 - 10098 
12 2023 档案
若干cpp的匿名函数
摘要: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 阅读(32) 评论(0) 推荐(0) 编辑
求逆矩阵
摘要: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 阅读(6) 评论(0) 推荐(0) 编辑
求1~n的逆元
摘要: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 阅读(5) 评论(0) 推荐(0) 编辑
cpp configuration for vscode
摘要: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 阅读(2) 评论(0) 推荐(0) 编辑
带通配符的字符串匹配
摘要: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 阅读(15) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示