「Cfz Round 2」How to Prove 题解
一道简单的构造题。
我们考虑先构造一个
容易发现,这会产生大量的
代码如下:
// 先搞点分,后面再调
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#define int long long
using namespace std;
signed main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
cout << "0 ";
int pos = 1;
int sgn = 1;
for (int i = 2; i <= n; i++) {
cout << pos * sgn << " ";
sgn = -sgn;
if (sgn == 1) pos++;
}
cout << endl;
}
}