denghuolanshan_1004 @ 2023-05-28 17:06:58
#include<iostream>
#include<cstring>
using namespace std;
int main(){
int a,x,cnt=0,p=0;
cin>>a;
int ans[a*a];
x=1;
while (x!=0){
cin>>x;
for(int i=0;i<x;i++){
ans[p]=cnt%2;
p++;
}
cnt++;
}
for(int i=0;i<a;i++){
for(int j=0;j<a;j++){
cout<<ans[a*i+j]<<" ";
}
cout<<endl;
}
return 0;
}
by Yun_Mengxi @ 2023-05-28 17:23:29
(点阵符号之间不留空格)
by GiudJava5242 @ 2023-05-28 19:35:12
话说为啥用你的代码提交有个点会MLE? 这么说,125MB > 125MB???
by Yun_Mengxi @ 2023-05-30 19:55:32
@Minecraft5242 好像等于也会MLE,并且可能空间是大于125MB的,而评测姬MLE后不会继续开空间了
by Yun_Mengxi @ 2023-05-30 20:02:55
#include<iostream>
#include<cstring>
using namespace std;
int main(){
int a,x,cnt=0,p=0;
cin>>a;
int ans[a*a];
x=1;
while (cin>>x){
for(int i=0;i<x;i++){
ans[p]=cnt%2;
p++;
}
cnt++;
}
for(int i=0;i<a;i++){
for(int j=0;j<a;j++){
cout<<ans[a*i+j];
}
cout<<endl;
}
return 0;
}
by Yun_Mengxi @ 2023-05-30 20:03:06
调好了
by Yun_Mengxi @ 2023-05-30 20:03:18
@denghuolanshanchu
by GiudJava5242 @ 2023-05-30 20:22:10
@Yun_Mengxi 哦哦哦哦哦哦
by denghuolanshan_1004 @ 2023-06-06 17:01:37
@Yun_Mengxi
爱你?(((