2^x-2^y其实可以枚举,O(30*30),可以过
for (ll j = 0; j < 30; j++) { for (ll k = 0; k < 30; k++) { if (dif == (1 << j) - (1 << k)) { ge[j]++; sh[k]++; flag = 1; break; } } if (flag) break; } if (flag == 0) { cout << "NO" << endl; return; }