b9113fced86a32cad0d8 @ 2024-05-23 20:28:04
我的提交记录
不知道哪个大聪明把它放进入门里的
by All_Wrong_Answer @ 2024-05-23 20:41:12
别抄
#include <bits/stdc++.h>
using namespace std;
int da[100005];
int main(){
int x,a,s=0,q=1;
cin>>x;
while(1){
if(x*x==s) break;
cin>>a;
for(int i=s+1;i<=s+a;i++){
if(q==1) da[i]=0;
if(q==0) da[i]=1;
}
q=(q+1)%2;
s+=a;
}
for(int i=1;i<=x;i++){
for(int j=1;j<=x;j++){
cout<<da[((i-1)*x)+j];
}
cout<<endl;
}
return 0;
}
思路就是先按输入的顺序涂色,再按格式输出
by All_Wrong_Answer @ 2024-05-23 20:42:10
@wenzhuoren
by llamn @ 2024-05-23 20:46:22
#include<bits/stdc++.h>
/*
#include<windows.h>
*/
using namespace std;
int a[205]; bool modle[205][205];
int main(){ int n; cin>>n; int x = 0; for(int i = 0;i < n n;){ cin>>a[x]; i += a[x]; x++; } / for(int i = 0;i < 105;i++){ cout<<a[i]<<" "; } system("pause"); / int sum = 0; int num = 0; bool type = false; for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++){ modle[i][j] = type; sum++; if(sum >= a[num]){ num++; sum = 0; type = !type; } / for(int q = 0;q < n;q++){ for(int w = 0;w < n;w++){ cout<<modle[q][w]; } cout<<endl; } cout<<"sum="<<sum<<endl; cout<<"num="<<num<<endl; cout<<"type="<<type<<endl; cout<<"x="<<j<<endl; cout<<"y="<<i<<endl; system("pause"); */ } } for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++){ cout<<modle[i][j]; } cout<<endl; } return 0; }
3. Hack : `3 0 9`
4. 修改 :先判断是否转换`type`,再记录输出。
5. [My AC code](https://www.luogu.com.cn/record/159976678)
by All_Wrong_Answer @ 2024-05-23 20:46:49
这又不难,入门很合理啊
by llamn @ 2024-05-23 20:46:55
@wenzhuoren