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 gemenhao at 2011-03-25 15:14:32 on Problem 3982
int main( )
{
	int n[4];
	BigInt A[4];

	while (scanf("%d %d %d", n, n + 1, n + 2) == 3) {
		A[0] = n[0];
		A[1] = n[1];
		A[2] = n[2];

		for (int i = 3; i <= 99; i++) {
			int j = i % 4;
			A[j] =  A[(i - 1) % 4];
			A[j] += A[(i - 2) % 4];
			A[j] += A[(i - 3) % 4];
		}

		A[3].print();
		printf("\n");
	}
	return 0;
}

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