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 |
求教! 问题就处在这个比较结构上了,但想不出是为什么T^Tbool cmp(int n1[], int n2[]) { int p1 = 0, p2 = -1; for (int i = 0;i < 6;i++) { if (n2[i] == n1[p1]) { p2 = i; break; } } if (p2 == -1)return false; bool f = true, f2 = true; int t1 = p1, t2 = p2; do { if (n1[t1] != n2[t2]) { f = false; break; } t1 = (t1 + 1) % 6; t2 = (t2 + 1) % 6; } while (t1 != p1); t1 = p1;t2 = p2; do { if (n1[t1] != n2[t2]) { f2 = false; break; } t1 = (t1 + 1) % 6; t2 = (t2 - 1 + 6) % 6; } while (t1 != p1); if (f || f2)return true; else return false; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator