| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
参考代码,的确是递推啊 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator