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 fangyixiang at 2008-09-06 08:20:37 on Problem 2033
       for(i=1;i<len;i++)
       {
          temp=(a[i-1]-'0')*10+a[i]-'0';
          if(a[i]=='0')
          {
             if(i>1) b[i]=b[i-2];
             else    b[i]=1;
             if(i>1) b[i-1]=b[i-2];
          }
          else if(temp>26)
          {
             b[i]=b[i-1];
          }
          else if(temp<10)
          {
             b[i]=b[i-2];
          }
          else
          {
              if(i>1)    b[i]=b[i-1]+b[i-2];
              else       b[i]=2;
          }
       }

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