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

build graph

Posted by digiter at 2011-08-10 23:25:06 on Problem 3678
			if (strcmp(s, "AND") == 0) {
				if (c == 0) G.add_edge(a, b + N), G.add_edge(b, a + N);
				else G.add_edge(a, b), G.add_edge(b, a), G.add_edge(a + N, a), G.add_edge(b + N, b);
			} else if (strcmp(s, "OR") == 0) {
				if (c == 0) G.add_edge(a + N, b + N), G.add_edge(b + N, a + N), G.add_edge(a, a + N), G.add_edge(b, b + N);
				else G.add_edge(a + N, b), G.add_edge(b + N, a);
			} else {
				if (c == 0) G.add_edge(a, b), G.add_edge(b, a), G.add_edge(a + N, b + N), G.add_edge(b + N, a + N);
				else G.add_edge(a, b + N), G.add_edge(a + N, b), G.add_edge(b, a + N), G.add_edge(b + N, a);
			}

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