上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: 假设ci=ai,那么一定有cj=aj(aj == bi),循环这个过程直到ck=ak(bk == ai),这个过程中所选出的元素为一个集合(在b中也有一个相同的集合,只是顺序不同) 不同集合数量为cnt,答案即为2^(cnt-m)(m为c确定的集合个数) #include<bits/stdc++.h 阅读全文
posted @ 2022-05-08 15:42 xhy666 阅读(68) 评论(0) 推荐(0)
摘要: 先用迪杰斯特拉剪枝,再dfs确定最佳方案 #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; const int N = 4010,INF = 0x3f3f3f3f; int n,m,c,t; int num 阅读全文
posted @ 2022-05-08 12:51 xhy666 阅读(34) 评论(0) 推荐(0)
摘要: 补题中 阅读全文
posted @ 2022-05-07 21:46 xhy666 阅读(17) 评论(0) 推荐(0)
摘要: 补题中 阅读全文
posted @ 2022-05-07 21:45 xhy666 阅读(18) 评论(0) 推荐(0)
摘要: 用队列模拟结束时间最轻便 #include<bits/stdc++.h> using namespace std; const int N = 1010; int finish[N]; unordered_map<int,int> ans; queue<int> q[N]; int main(){ 阅读全文
posted @ 2022-05-06 19:45 xhy666 阅读(32) 评论(0) 推荐(0)
摘要: ``` ``` 阅读全文
posted @ 2022-05-06 01:13 xhy666 阅读(116) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; const int N = 2e5+10; int fa[N]; bool isleaf[N]; int get_dis(int x){ int res=0 阅读全文
posted @ 2022-05-06 01:12 xhy666 阅读(95) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); int test; cin>>test; while(test--){ int n,a,cnt=0; bool flag=tru 阅读全文
posted @ 2022-05-06 01:11 xhy666 阅读(16) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); int test; cin>>test; while(test--){ int ans; string s; cin>>s; i 阅读全文
posted @ 2022-05-06 01:11 xhy666 阅读(13) 评论(0) 推荐(0)
摘要: floyd的变形,本质是求从i号顶点到j号顶点只经过前k号点的最短路程。 #include<bits/stdc++.h> using namespace std; const int N = 300,INF = 0x3f3f3f3f; int n,m,qn; int g[N][N],t[N]; vo 阅读全文
posted @ 2022-05-05 22:30 xhy666 阅读(36) 评论(0) 推荐(1)
上一页 1 ··· 7 8 9 10 11 12 13 下一页