Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

构图不会看这里

Posted by schindlerlee at 2009-09-15 16:29:34 on Problem 2226
横向或者纵向连续的*取为一个编号

        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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator