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

求教! 问题就处在这个比较结构上了,但想不出是为什么T^T

Posted by suuusu at 2019-05-04 10:20:13 on Problem 3349
bool 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:
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