题解:P11925 [PA 2025] 显像管 / Migawka
huangzhiyuanhzy · · 题解
题意理解
错误块的定义
一个
1 0
0 1
或
0 1
1 0
即只有主对角线或副对角线上的像素亮,其他灭。
规则
每秒必须选择至少一个错误块,反转其中所有像素(亮变灭,灭变亮)。
目标
构造初始画面,使得从它开始,按规则能生成的不同画面数量最多。
参考代码
很容易就能够写出如下代码:
#include<bits/stdc++.h>
using namespace std;
int a[1010][1010];
int main(){
a[1][1]=1;
for(int i=2;i<=100;i++){
for(int j=2;j<=100;j++){
if(j==100||i%2==0){
a[i][j]=1;
}
else{
a[i][j]=0;
}
}
}
for(int i=1;i<=100;i++){
for(int j=1;j<=100;j++){
cout<<a[i][j];
}
cout<<endl;
}
return 0;
}