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

Re:求大牛帮忙看看啊!!!

Posted by hejunfei at 2011-10-13 00:14:01 on Problem 1390
In Reply To:求大牛帮忙看看啊!!! Posted by:hejunfei at 2011-10-12 23:42:33
已经AC了,
for(i = 1; i < id-2; i++){  //after[i] 的值为下一段与第i段颜色相同的下标
			if(vis[i]) continue;
			int tmp = i;
			for(j = i+2; j < id; j++)
				if(color[tmp] == color[j]){
					after[tmp] = j;
					tmp = j++;
					vis[j] = true;
				}
		}
改成 tmp=j; vis[j++] = true;

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