Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int n;
- int arr[2002];
- vector<pair<int, int> > g[2005];
- int main() {
- cin >> n;
- for(int i = 0; i < n; i++) {
- cin >> arr[i];
- for(int j = 0; j < (1 << 12); j++) {
- if(__builtin_popcount(j) == __builtin_popcount(arr[i])) {
- int p = (j ^ arr[i]);
- g[i].push_back(make_pair(j, __builtin_popcount(p) / 2));
- }
- }
- }
- return 0;
- }
- // 110000000000
- // 000000000011
- // 110000000011
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement