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 888899977 at 2007-10-12 17:25:56 on Problem 1012
int f(int n,int m,int t)
{
    if(t==1) return (m-1)%n;
    else return (m%n+f(n-1,m,t-1))%n;
}//n人报m第t轮出列的人的编号(从0到n-1)

这样就可以ac了。

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