Discription You are given two multisets A and B. Each multiset has exactly n integers each between 1 and n inclusive. Multisets may contain multiple copies of the same number. You would like to find a nonempty subset of A and a nonempty subset of B s…
F. Double Knapsack 题目连接: http://www.codeforces.com/contest/618/problem/F Description You are given two multisets A and B. Each multiset has exactly n integers each between 1 and n inclusive. Multisets may contain multiple copies of the same number. Y…
哇塞?开始的三个数其中两个数一定能确定一个序列.(鸽巢原理) #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N=3e4+10; int a[N],n; bool vis[N]; void print(vector<int>v) { int sz = v.size(); for(int i=0; i<sz; i++) printf("%d ",v[i…