题解:P16220 [ECUSTPC 2025] 浮点
swate114514 · · 题解
首先肯定要想最优怎么安排
需要
我们知道两数相同异或为
11111
100000
上图中已经展现了对于异或最优的情况,每一位都不同,但因为位数不同,但是
输出序列只要输出二进制数位数一样的就行了,即
因为值域在 -1 是诈骗……
直接输出
/*
Code by swate114514.
*/
#include <bits/stdc++.h>
#define int long long
using namespace std;
int _;
inline int read() {int s = 0, w = 1; char ch = getchar();while (ch < '0' || ch > '9') {if (ch == '-') w *= -1;ch = getchar();}while (ch >= '0' && ch <= '9') {s = (s << 3) + (s << 1) + (ch ^ 48);ch = getchar();}return s * w;}
inline void write(int x) {if (x < 0) x = -x, putchar('-');if (x > 9) write(x / 10);putchar(x % 10 + '0');}
const int b = 1 << 29;
int n;
inline void solve() {
n = read();
n += b - 1;
for (int i = b; i <= n; ++i) write(i), putchar(' ');
putchar('\n');
}
signed main() {
_ = read();
// _ = 1;
for (int i = 1; i <= _; ++i) solve();
return 0;
}