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

why总是output limit exceed???thanks!

Posted by y05ww at 2006-03-12 15:19:29 on Problem 1207
#include<iostream>
using namespace std;
int main()
{
    int m,n,i,j,c1=1,c=1,k=1;
    for(k=1;;k++) {
                   cin >>m >>n;
                   int M=m;
                   int N=m;
                   int o=n-m;
                   for(i=0;i<=o;i++) 
                   {
                                    for(j=1;;j++) {
                                                   if(m==1) break;
                                                   else if(m%2==1) m=1+3*m;
                                                   else m=m/2;
                                                   c1++;
                                     }
                                     if(c<=c1) c=c1;
                                     c1=1;
                                     M++;
                                     m=M;
                   }
                   cout <<N <<' '<<n <<' '<<c <<endl;
                   c=1;
    }
    system("pause");
}

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