摘要:
暴力吗,没什么技术含量。 程序: #include<bits/stdc++.h> using namespace std; int n,m; int a[101]; string s[1002]; int vis[101]={0}; int main() { ios::sync_with_stdio 阅读全文
摘要:
题目 那么先把A1,A2所组成的等式列出来: 解出A1: 之后,我们可以发现问题变成了求1~n之间任意和为A1的可能性——01背包。顺便看一眼,要用long long! 完整代码: #include<bits/stdc++.h> using namespace std; int n,m; long 阅读全文
摘要:
这道题目是个并查集,显而易见,只要注意别超时了就好。 点我了解并查集 程序: #include<bits/stdc++.h> using namespace std; const int N=5e5+10; int n,m,fa[N]; int find(int k) { if(fa[k]==k) 阅读全文