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 |
build graphif (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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator