思路
?第一反应:。然后你会开心地发现你 WA Pretest #2 了。这里给出一组 Hack:6 2 1。
终于明白为什么是 而不是 了。我们只要 ,前后两端都是 交替就行辣。
代码
# include <bits/stdc++.h>
# define I return
# define AK 0
# define IOI ;
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
int t, n, x, y;
int main () {
ios::sync_with_stdio (0);
cin.tie (0);
cout.tie (0);
cin >> t;
while (t --) {
cin >> n >> x >> y;
for (int i = y - 1; i; -- i)
cout << (i & 1 ? "-1 " : "1 ");
for (int i = y; i <= x; ++ i)
cout << "1 ";
for (int i = 1, tmp = n - x; i <= tmp; ++ i)
cout << (i & 1 ? "-1 " : "1 ");
cout << '\n';
}
I AK IOI
}