摘要: A题 模拟 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod1=1e9+7; const int mod2=1e9+9; int base=11; struct X{ int x,y; i 阅读全文
posted @ 2020-10-05 22:03 朝暮不思 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 将图的所有状态都存下来,一步一步bfs遍历,但是需要去重,由于重载运算符过于复杂,因此考虑用双哈希去重 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod1=1e9+7; const int 阅读全文
posted @ 2020-10-05 21:59 朝暮不思 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 观察到所有成环的之间的距离都是1,因此可以想到使用tarjan缩点后建立园方树 这样答案就是两点间距离/2 #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pll; const int N=1e6+10; int 阅读全文
posted @ 2020-10-05 10:27 朝暮不思 阅读(153) 评论(0) 推荐(0) 编辑