算法
(构造) $O(t * \max(a, b))$
构造
$$\underbrace {1 \cdots 1}_{a-c+1\mbox{个}} \overbrace {0 \cdots 0}^\{c - 1\mbox{个}\}$$
$$1\underbrace{0 \cdots 0}_{b - 1\mbox{个}} $$
即可。
C++ 代码
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
using std::cin;
using std::cout;
int main() {
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
rep(i, a - c + 1) cout << "1";
rrep(i, c - 1) cout << "0";
cout << " 1";
rrep(i, b - 1) cout << "0";
puts("");
}
return 0;
}
\underbrace
有点东西