思路
链接:https://blog.csdn.net/m0_59273843/article/details/124281957
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int a[500000],c[500000];
void solve() {
int n;
cin >> n;
for(int i = 1;i <= n; i++){
cin >> c[i];
a[i] = 1;
}
for(int i = 1;i <= n; i++){
if(c[i] == 0){
a[i] = 0;
}
else{
int t = c[i] - (i-1)*a[i];
a[i+t] = 0;
}
cout << a[i] << " ";
}
cout << "\n";
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int T;
cin >> T;
while(T--) {
solve();
}
return 0;
}