随笔分类 - 《算法竞赛进阶指南》打卡活动
92. 递归实现指数型枚举
摘要:题解:递归,加数组 点击查看代码 #include<iostream> #include<algorithm> #include<cstring> using namespace std; const int N=1e5+7; int n; int a[N]; void dfs(int x,int
91. 最短Hamilton路径
摘要:算法:动态规划位操作压缩 题解:e[i][j] i表示路线 ,j表示终点 ,初始化e[1][0]=0,表示从0点出发。 例如:i=7,n=4,二进制为 0111 表示经过 点 0 1 2 。 点击查看代码 #include<iostream> #include<algorithm> #include
90. 64位整数乘法
摘要:点击查看代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e6 + 10; ll a,b,p; ll solve() { ll ans=0; while(b) { if(b&1)
89. a^b
摘要:点击查看代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e6 + 10; ll a,b,p; ll solve() { ll ans=1; while(b) { if(b&1)