摘要: ###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 阅读全文
posted @ 2020-09-21 11:25 Rynar 阅读(662) 评论(0) 推荐(0)
摘要: 刷题目前,请先了解nim game和sg函数的部分知识 ###hdoj1730.Northcott Game 当棋子紧贴着时先手必输,n行紧贴的棋子先手必输,原题相当于取完n行两棋子中间的部分构成n行紧贴的局面,等价于nim game #include<bits/stdc++.h> using na 阅读全文
posted @ 2020-08-27 16:56 Rynar 阅读(206) 评论(0) 推荐(0)
摘要: ###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 阅读全文
posted @ 2020-08-24 12:51 Rynar 阅读(179) 评论(0) 推荐(0)
摘要: ###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] 阅读全文
posted @ 2020-08-21 11:46 Rynar 阅读(654) 评论(0) 推荐(0)
摘要: ###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时, 阅读全文
posted @ 2020-08-18 17:53 Rynar 阅读(296) 评论(0) 推荐(0)
摘要: ###1003.Clockwise or Counterclockwise #include<bits/stdc++.h> using namespace std; typedef long long ll; struct node{ ll x,y; }a[10]; ll xj(node a,nod 阅读全文
posted @ 2020-08-13 18:58 Rynar 阅读(363) 评论(0) 推荐(0)
摘要: ###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> 阅读全文
posted @ 2020-08-10 17:47 Rynar 阅读(218) 评论(0) 推荐(0)
摘要: ###A.Groundhog and 2-Power Representation 赛中 s=str(input()) b=0 def dfs(l,r): if r-l==1: return ord(s[l])-ord('0') ans=0 i=l while i<r: if (s[i]=='2') 阅读全文
posted @ 2020-08-08 17:29 Rynar 阅读(227) 评论(0) 推荐(0)
摘要: ###1005.Fragrant numbers 思路:区间dp,数据量只有5000,也可以打表 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define int ll const int N=5000+20 阅读全文
posted @ 2020-08-07 12:26 Rynar 阅读(242) 评论(0) 推荐(0)
摘要: ###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; 阅读全文
posted @ 2020-08-04 18:07 Rynar 阅读(313) 评论(0) 推荐(0)