摘要:
跳跳 #include<bits/stdc++.h> using namespace std; int gcd(int x ,int y){ return y == 0 ? x : gcd(y , x % y); } #define x first #define y second struct n 阅读全文
摘要:
P1776 宝物筛选 多重背包+二进制优化 #include<bits/stdc++.h> using namespace std; const int N = 1000005; int v[N] , w[N] , num[N]; int n , m; int f[N] ; int cnt; int 阅读全文
摘要:
P1796 汤姆斯的天堂梦 dp #include<bits/stdc++.h> using namespace std; int f[102][102]; int n , k; int main () { cin >> n; for(int i = 1 ; i <= n ; i ++){ cin 阅读全文
摘要:
P1636 Einstein学画画 欧拉路 // luogu-judger-enable-o2 // luogu-judger-enable-o2 #include <bits/stdc++.h> using namespace std; int n,m,ans; int x,y; int a[10 阅读全文
摘要:
T1P5318 【深基18.例3】查找文献 dfs和bfs用set存方便排序 #include<bits/stdc++.h> using namespace std; set<int>a[1000020]; int v[1000020]; int n , m; void dfs(int x){ if 阅读全文
摘要:
P1616 疯狂的采药 完全背包,一维数组正着做就可以 #include<bits/stdc++.h> using namespace std; int v[100200] , t , m; int f[100020] , w[100020]; int main () { cin >> t >> m 阅读全文
摘要:
第三次双周赛 T1 map的简单运用,或者读进来再一个一个判断就行。 #include<bits/stdc++.h> using namespace std; map<char ,int> m; int a[9]; int main () { m['1'] = 1; m['A'] = 1; m['Q 阅读全文
摘要:
https://pintia.cn/problem-sets/1596422372713025536 T1全排列裸题,可以用dfs,我喜欢~~next_permutation~~ #include<bits/stdc++.h> using namespace std; int n; int a[10 阅读全文