摘要:
考虑一个点被使用的奇偶次 这种题如果是边的话,就是经典套路 现在是点,其实可以把他周围的边都计算一遍就知道这个点用了多少次 同时不要忘了加上以他为顶点的n-1条路 #include<bits/stdc++.h> using namespace std; typedef long long ll; t 阅读全文
摘要:
40有点大,我们考虑折半查找 这样每个字符串有取和不取两种可能 之后乘法原理即可 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pll; const int N=5e6 阅读全文
摘要:
行列无关,因此对于行列分别求解 这题的题目有个错别字,有打成由了,我做的时候没理解求的啥 ,尴尬了 其他就是状态机dp,表示这个位置向左还是向右 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pa 阅读全文
摘要:
贪心点思路很简单,就是根据邻项微扰原则,进行比较两邻项,移项后就能看出公式 但是在这题显然爆ll,因此要用高精度 抄了一下int128的板子,以前虽然碰到过但是都没有记录下来 #include<bits/stdc++.h> using namespace std; typedef long long 阅读全文