freopen("area0.in","r",stdin);freopen("area0.out","w",stdout);
int ll=0; cin>>a>>b; for(int z=1;z<=a;z++) for(int y=1;y<=b;y++) cin>>u[z][y]; i(0,0); for(int z=1;z<=a;z++) for(int y=1;y<=b;y++) { if(u[z][y]=='0') ll++;} cout<<ll; }
题目 23 [HAOI 2005]寻找编码串
2019-06-17 19:42:54
|
|
#include<bits/stdc++.h>
using namespace std; char u[102][102]; int a,b; void i(int x,int y) { u[x][y]='^'; if((u[x][y+1]=='0'||u[x][y+1]==0)&&y<=b) i(x,y+1); if((u[x+1][y]=='0'||u[x+1][y]==0)&&x<=a) i(x+1,y); if((u[x][y-1]=='0'||u[x][y-1]==0)&&y>=1) i(x,y-1); if((u[x-1][y]=='0'||u[x-1][y]==0)&&x>=1) i(x-1,y); } int main() {
题目 23 [HAOI 2005]寻找编码串
2019-06-17 19:42:34
|
|
@CAX_CPG 大神求代码
题目 23 [HAOI 2005]寻找编码串
2014-10-15 06:10:20
|
|
CAX大神求算法
题目 23 [HAOI 2005]寻找编码串
2013-04-11 09:00:54
|