seo课程哪个好上海网站seo外包
题意:https://www.luogu.com.cn/problem/AT_abc200_d
思路:对于一个序列最多有多少个模数,其实就是子序列个数,所以当子序列个数超过200是那么答案一定存在,那么我们就可以直接枚举了,所以我们直接枚举前八位的状态即可。
/*keep on going and never give up*/
#include<cstdio>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
using namespace std;
#define int long long
typedef pair<int, int> pii;
#define lowbit(x) x&(-x)
#define endl '\n'
#define wk is zqx ta die
int a[205];
vector<int> pl[205];
signed main() {std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int n;cin >> n;for (int i = 0; i < n; i++) {cin >> a[i];}int cnt = min((int)8, n);for (int i = 1; i < (1 << cnt); i++) {vector<int> p;int res = 0;for (int j = 0; j < n; j++) {if ((i >> j) & 1) {res += a[j];p.push_back(j);res %= 200;}}if (pl[res].size() == 0) {pl[res] = p;} else {cout << "Yes" << endl;cout << pl[res].size() << " ";for (auto g : pl[res]) {cout << g + 1 << " ";}cout << endl;cout << p.size() << " ";for (auto g : p) {cout << g + 1 << " ";}return 0;}}cout << "No" << endl;return 0;
}