Question V: yy time limit for Bachelor: 1 Sec memory limit: MB submitted: 22 [Submit] [status] [discussion version] Title Description
-
YY often meet a strange thing, whenever he sees time, always see 11:11, this is very tangled ah.
Now give you M 1, you can put 2 1 groups to synthesize a 2, so it is not a bachelor, ask such a combination how many kinds??
For example (111 can be split into 111 12 21 with three types)
Input
The first line inputs an n to indicate that there are n test data for the following n rows, each line input M 1 (1 <= n,m <= 200)
Output
Output This combined seed number, one row
Sample input
31111111111
Sample output
238
The problem is actually asking for the first 200 Fibonacci series + Large Numbers
1#include <iostream>2#include <string.h>3 using namespacestd;4 5 Chara[222];6 inttag;7 intf[222][1111],t;8 9 voidFB ()Ten { One inti,j; AMemset (F,0,sizeof(f)); -f[0][0]=f[1][0]=1; - for(i=2;i<222; i++) the { -tag=0; - for(j=0; j<= $; j + +) - { +tag=f[i-1][j]+f[i-2][j]+tag; -f[i][j]=tag%Ten; +Tag/=Ten; A } at } - } - - intMain () - { - intna,i,j; in FB (); - while(cin>>t) to { + while(t--) - { theCin>>A; *Na=strlen (a); $ for(i= $; i>=0; i--)Panax Notoginseng { - if(f[na][i]!=0) the Break; + } A for(j=i;j>=0; j--) the { +cout<<F[na][j]; - } $cout<<Endl; $ } - } - return 0; the}
1254 Problem V