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

What's Wrong?

Posted by songuno1 at 2006-01-22 19:19:12 on Problem 2748
#include <stdio.h>

int T, N;
int D[750000]={0,1,2};

int main (){
	int i;
	
	for (i=3; i<750000; i++){
		D[i]=(D[i-1]*3-D[i-2])%100000;
		if (D[i]<0) D[i]+=100000;
	}
	scanf ( "%d", &T );
	
	for (i=0; i<T; i++){
		scanf ( "%d", &N );
		N%=750000;
		printf ( "%d\n", D[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