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

分过程 ------>

Posted by Bluebird at 2005-07-21 21:00:33 on Problem 2500
In Reply To:主过程没有问题. Posted by:c0500448242 at 2005-07-21 20:57:01
int compare(int *x, int *y)
{
	if (*x > *y) return 1;
	if (*x < *y) return -1;
	return 0;
}


double getarea(int a, int b, int c)
{ double x1, y1, x2, y2, x3, y3;
	x1 = d * cos(a * alph);
	y1 = d * sin(a * alph);
	x2 = d * cos(b * alph);
	y2 = d * sin(b * alph);
	x3 = d * cos(c * alph);
	y3 = d * sin(c * alph);

return fabs(x1 * y3 + x2 * y1 + x3 * y2 - x1 * y2 - x2 * y3 - x3 * y1) / 2;
}

main :

		scanf("%ld%ld%ld%ld", &d, &n, &c, &g);
		d >>= 1;
		alph = 2 * pi / n;
		for (i = 0; i < c; i ++)
			cc[i] = (__int64(g) * i) % n;
qsort(cc, c, sizeof(cc[0]), (int(*)(const void*, const void*)) compare);

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