#include #define int long long #define x first #define y second #define pi acos(-1) using namespace std; using LL = long long; using ULL = unsigned long long; typedef pair PII; const int N = 1e6 + 10, M = 5010, mod = 1e9 + 7; void solve() { int n; cin >> n; vector a(n + 1); int p = 0; unordered_map mp; int p2 = 0, p3 = 0; for(int i = 1; i <= n; i++){ cin >> a[i]; if(a[i] == 0){ p = i; } if(mp[a[i]] != 0){ p2 = mp[a[i]]; p3 = i; } mp[a[i]] = i; } if(p != 0){ cout << 1 << "\n"; cout << p << "\n"; return; } if(p2 != 0){ cout << 2 << "\n"; cout << p2 << " " << p3 << "\n"; return; } /* 使B集合里的数的各个bit位的数量都为偶数 考虑bit位数量大于等于2的位置 反向思考 如果某个bit位的数量为1 则相应的这个数一定使不会取的 迭代删除不符合的数 最后剩下的一定能够构造出符合答案的集合 ? 奇数的情况 ? 7 3 6 1 2 4 1 2 2 4 奇数定! 线性基 */ vector d(61); auto add = [&](int x, int y)->void{ for(int i = 59; i >= 0; i--){ if((x >> i) & 1){ if(d[i].x) x ^= d[i].x; else{ d[i].x = x; d[i].y = y; break; } } } return; }; for(int i = 1; i <= n; i++){ add(a[i], i); } int cnt = 0; for(int i = 0; i < 60; i++){ if(d[i].x != 0) cnt++; } if(cnt == n || cnt == 1){ cout << -1 << "\n"; }else{ cout << cnt + 1 << "\n"; int res = 0; for(int i = 0; i < 60; i++){ if(d[i].x) cout << d[i].y << " ", res ^= d[i].x; } for(int i = 1; i <= n; i++){ if(a[i] == res) cout << i << "\n"; } } } signed main() { ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int T = 1; //cin >> T; while(T--) { solve(); } }