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

k==0可能么?见内,为什么RE?????

Posted by lfj_2 at 2006-09-29 23:00:24 on Problem 3012
Problem Id:3012  User Id:lfj_2 
Memory:2684K  Time:15MS
Language:GCC  Result:Runtime Error

Source 

#include<stdio.h>
int md,nd,m;
gtmd(k){
	int t;
	if(k==1)return 10%m;/////////////////////////改成if(k==0)return 1;就以92K内存ac,whyyyyyyy?
	t=gtmd(k/2);
	t=(__int64)t*t%m;
	if(k%2)t=(__int64)t*10%m;
	return t;
}
getnd(n){
	int t;
	if(n==0)return 1;
	if(n==0)return md;
	t=getnd(n/2);
	t=(__int64)t*t%m;
	if(n%2)t=(__int64)t*md%m;
	return t;
}
main(n,k){
	for(scanf("%d",&n);~scanf("%d%d%d",&n,&k,&m);printf("%d\n",nd))
		md=gtmd(k),md++,md%=m,nd=getnd(n);
}



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