Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
构图不会看这里横向或者纵向连续的*取为一个编号 for(icnt = 0,i = 0;i < m;i++) { for(j = 0;j < n;j++) { if(map[i][j] == '*') { a[i][j] = icnt; } if(map[i][j] == '*' && map[i][j+1] != '*') { icnt ++; } } } for(jcnt = 0,i = 0;i < n;i++) { for(j = 0;j < m;j++) { if(map[j][i] == '*') { b[j][i] = jcnt; } if(map[j][i] == '*' && map[j+1][i] != '*') { jcnt ++; } } } for(i = 0;i < m;i++) { for(j = 0;j < n;j++) { if(map[i][j] == '*') { g[a[i][j]][b[i][j]] = 1; } } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator