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 |
比较菜的做法,简单不易出错,纯字符串替换。。。。。。boolean left, right; newString= s.replace(ExpVars[len], '0'); left = solve(newString, len-1); newString= s.replace(ExpVars[len], '1'); right = solve(newString, len-1); if(left&&right) return true; else return false; public static String[][] rules={ {"N1","0"},{"N0","1"}, {"K11","1"},{"K10","0"},{"K01","0"},{"K00","0"}, {"A11","1"},{"A10","1"},{"A01","1"},{"A00","0"}, {"C11","1"},{"C10","0"},{"C01","1"},{"C00","1"}, {"E11","1"},{"E10","0"},{"E01","0"},{"E00","1"}, }; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator