摘要:
###1001.Art Class ###1002.Graph Theory Class Min25筛 ###1003.Express Mail Taking #include<bits/stdc++.h> using namespace std; const int N=1e2+10; typed 阅读全文
摘要:
刷题目前,请先了解nim game和sg函数的部分知识 ###hdoj1730.Northcott Game 当棋子紧贴着时先手必输,n行紧贴的棋子先手必输,原题相当于取完n行两棋子中间的部分构成n行紧贴的局面,等价于nim game #include<bits/stdc++.h> using na 阅读全文
摘要:
###hdoj1796 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll const int N=20+10; int n,m; int a[20]; int gcd(int x,int 阅读全文
摘要:
###1003.Mine Sweeper #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=25+10; const int mod=1e9+7; int n,m,k; int a[N][N] 阅读全文
摘要:
###1002.Absolute Math 思路:借鉴于https://www.cnblogs.com/DeaphetS/p/13525554.html ###1003.Slime and Stones 思路;betty定理,1/x+1/(x+k+1)=1的大解,(a-b)/(k+1)*x==a时, 阅读全文
摘要:
###C.Decrement on the Tree 硬生生地写成了树形dp,写了160行 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef pair<int,int> 阅读全文
摘要:
###1005.Fragrant numbers 思路:区间dp,数据量只有5000,也可以打表 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll const int N=5000+20 阅读全文
摘要:
###1001.Tetrahedron 思路:可以叉积,余弦定理+1/2absin,海伦公式,计算得1/h^2=1/a^2+1/b^2+1/c^2,a为1-n,所以期望为3*(1+1/2^2+...+1/n^2)/n typedef long long ll; const int N=6e6+10; 阅读全文