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

2509 老超时 有没有好的算法 阿

Posted by muyue at 2008-08-02 15:40:00 and last updated at 2008-08-02 15:40:21
#include<stdio.h>
#include<string.h>
int main(){
    long i,j,k,m,n;
    while(scanf("%ld %ld",&m,&n)!=EOF){
        for(i=0;i<m;i++){
            if(i%n==0)
                m++;
                                               
        }                
        printf("%ld\n",m-1);
    }
    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