uva 10069 Distinct Subsequences 不同的序列

原题:
A subsequence of a given sequence is just the given sequence with some elements (possibly none) left
out. Formally, given a sequence X = x1x2…xm, another sequence Z = z1z2…zkis a subsequence
of X if there exists a strictly increasing sequence < i1,i2,…,ik > of indices of X such that for all
j = 1,2,…,k, we have xij= zj. For example, Z = bcdb is a subsequence of X = abcbdab with
corresponding index sequence < 2,3,5,7 >.
In this problem your job is to write a program that counts the number of occurrences of Z in X as
a subsequence such that each has a distinct index sequence.
Input
The first line of the input contains an integer N indicating the number of test cases to follow. The
first line of each test case contains a string X, composed entirely of lowercase alphabetic characters
and having length no greater than 10,000. The second line contains another string Z having length no
greater than 100 and also composed of only lowercase alphabetic characters. Be assured that neither
Z nor any prefix or suffix of Z will have more than 10100 distinct occurrences in X as a subsequence.
Output
For each test case in the input output the number of distinct occurrences of Z in X as a subsequence.
Output for each input set must be on a separate line.
Sample Input
2
babgbag
bag
rabbbit
rabbit
Sample Output
5
3
题目大意:
题目很好理解,就是给你给你两个字符串,比如字符串s1和字符串s2,问在字符串s1里面有多少个不同的字符串s2。
例如:
abbc
abc
答案是2,可以取第一个字符串中的124和134。
思路见代码下方:
在此,给出一个数据(呵呵了)
1
yytndnyztetptyxvqwtyjwzbzpizhwnpzqbevcbduyaizuwkdscaufjkkozyqtwrcjwxkohcsnvuoqhpngryrtqvzkjuyzhuwgqbxsztwwckstzlfszbqscwwhutuxiwdxpluotribovodozksddartkpehehbfsxajgoftvxbiozaqyolefaoddhyfjhijatwiuqasohudacyyxplxyiejvelfyhromqjgwmhczjmvxldjkadjjoaodkdfwvxswcsnohikwmbhiwjoqkbpplmkipmzettcfodrpwkiswjyryulqfyqogrlngoyailebfdyljawbgeohofebuwvrahhjrumcciczdmkojcxpfijioqbsyvcybaqmqtdtxudhpycmqvzxdyinxciarnprdfpefxmcbnygqyhmnhumyqfdmikwewcpycbyfdgplnbhwlzytgbilwesfodwuxylersortflasqvuxokqechfouxbudxrjcaxkqnmpamjkbjhndwbjbytkkqhwcsyicxxxgkyxeuulqkvhknhftfiyxcnkbiudciwhymrvwhfbnplszdesqjkmrjkfzoxsenyaqucooczsconmzukdxczeuqxlmfftphwnnksknptpqqwqqgxiiygpykivywnkiqdoljaodjdkogvdykxhxoetrasxfcazgjemrvejeoohlfwpekucnxhgutrqfqfgshlzjmkvvnhwxsmfihmzuviilsisxmyevjkrhbyymvafaqzrljhabycfiygocbmromqesbwylpegpyaktrxjwzjlrjpiawiissolicodxwcznzogeasbjiauraajpksewityxodbevehxefrjfybpscloixfeqpnswhoyiqoozvkbpcdwljdqsfjqujlrvltyummvfmvmqtmftsilraoqvucyxdvgsrvmpocefjywrdjjnfqnoioxajxryhxyjbyvypoovojxeynveobcmgtkhnwteijnfcmuchwuvzunfsambmysmgrihbvorhjukvetcwkiphhqgwgpwzvgtsnfmxwvuqylqkqakenwhlertwpriwslkljrrqceaojmasyvsfuqhttwjfjhptjjumsduslvueaabegzrwfwigztpixxofkgchqdiosgkgwrjrgxlmzyoecjgubvdvfklbwfqhteualskhkirqqkaixdyrnjpvifvvkkbyryqzrhriqtaqsktztjefjszgltblgeizwegisekfsvpczsdfopjqfbigakxkbbhwsadgksepnztlfqujiruklcvyakkviqjcqityxxqyrouyelmwiralpnyvlzsybsnuljzyyfvfjxdqhqlkzwsyafwzhnogttilhekmpwmxwycdmbkurxfwucpjutpgwrvnhzrnndcahvaxcsjrbirspodaeyregmjplqlgvvwltazyeojpbplubjdossdozqtunvnhjkalsmyqexworkeqeamctnzzvycitqqxvmvyhwwbknuljarhmooxhukqubrjfgcjjtrrbsfhbwyztkzypjplhvcegbsojgihzqqlwwgswnjjpsrijhwbpqilvkmspcaaualsfanutxjhlaqpgoivvbhtvacuzevugfrievnqtcqusaegdnbdtdrsvefyelfsnzmunwgjyizvuhwuaakfpjthjrkomnwzyumzzkvkspgsalwzbngqtzhkzbcmuwqjrnaawclxroywnefuoriqjpkjdygavpcnsyelvbrifcsplhvpxnrfubixziwchkwerbzmoocowvvsyblcahnasseoxinuwwmyfdplymusybsmlcuapdmiczzvbyhgxxwzgtqanqarposbnoulnujlruqxkkjgphnzajyznmqxcfatkwmrqaquxjigyvxbalmjcbdmcqtidawdhcowmrsowmafzatcpjkvgvqdssreqhtewmplxbwfxwznlzvgyhkdawueefnxxxrtrybvzvzszfznyaerdaqmcbuzlqsvkkanqxfkeeueebrziymzckefqfusjroeldlspnqbeagfzxqhlrdzltjmhhrdfyemkgvsuatvjrwpkwzglvbqssdtkrklzbybongupifotfktxajpdmzdwvdfjvilplvevhizxtotzvjkkphcflxspxuhtqmqryjcdyigqqvwhvkzzfygkrlsmknoutaujmvmifgphaacpnkxeyfmlerqqgddsqjfpsoggulkdobytbuyzekggkomlcyojltsedrkbfktomfyhtpoxrelfxyfpctzhleewhnhvzwougxzreyompfenysbejqjoivtkmsoigcrupoojbatwobhkrskcrgnrgnezbjoyiztrhzxcptxngtrbmxnkotkykpmtqmisewhdmkygcizfcydaiqwozweumytyzieohlgvtzynodqajmfkwyxguwdweaurgbwdqterovdfdywqrcdzgyefrhxmjtihkylslhcroebqykuccsevqtgtzbigpcviugqeuomzvnkakurplfnizqyorhusxtktgdnixdvnnplhngpxszlujnmuarfmdlnqyeucipotnikhvjydnpngyjdcaqvrbhjnyhincrnvncaeglnpagrygncqtbadkcbufhnkbkfngcodlnhjaivlycpqpdlqovlhjubvjxkyimjenbdjojiadfzfkvlgzasyorwdaitsxtbdsuapiyldjjkljuztoarfpbrajohzegsyqheiermagfpuhlbtsnoalnjuiwqfvozbjtpkifcbmztytvlqnixkeiqktfzwwuhabvgqdhqsmawpmemavxivogusraxsezznxfcrqakkgapcgxfdilxiemhhnqolzatlqobdvxclaxhyhtaqifaikyqrfyzuzakiaayyodlmxiwxpfapaffkobjrzczjpzpaxvqazrcxtikkfuyphsspytsbgjoebuujwknftuepdbwjilfdvedljfohwaobyftdbuqsyyimuxrgebxxskdhqeurjkkacqhcwpahkcidfxexvcmjeyhevyqrkypnnmdqovztangqwncaintgkpqcwyagdbocoiuldzjuvynwbmltzefdfksujyxhsqmnnsiojvdxzkgxqirsafpujqqctnxecwdqoezfbouqqkwgrtnaffluccgiwfocjstckvxjecrbmtdnmhcfzlgrketiqjgxhelrujfzulztnsxubicrzpmbirqjsowlthmztnkvroaifpirupcmnhcuudllppdecmqkkmdntoahyruwrntklcviaftdvxhgcogeqdlupfkooixxhjhbvkhvjfsekalkhctxejitbrryzucsrzdvkmjkruzqhbeqxzldrniwxfxfhkymiqmzduxbttrnusorzoelcqpeklbvvnyjwjcshwonifmvjgyejvhfhmdzqiefgzyvpvgahennvrpomvabffizkudraheymlxiqniiyyspiljzcaxyovfdlngmujowzppynpjgpfutlkqfwmyruwgdjmaaolxemybjwgsudoqgyhuiazfesxcxlsentarwbwcpsatmdxonndkjamvnznzxnufvfbebgyaqwqprjdfomtowyneyidizrpfvdwpvhbkliuotxygcjykftxtetsafpktxzcxnxwwoynvjschxhhcgbqpxfmeseovwlwhufitoqajgsiidbbfxsfgfzuiuavedkhconzyiukkebncchxvqltdcnqiefotswgusjclylqzoevowhphkzxtexocveiyznydohqpywapnlxdteuidiwotuxakeguxeaspqkjtrvqilzmbebzkqsdbmswsfjqbveehndliqwjqcpzaxfqoukfrcbklbxobstlceienuwdlmqspsxrhmukjotoswhguqnyedeofxsoaasugdaqpkhfakqgjgnfcvjyngqkcdftnkzowshtmefmllzllfemdwnvfmrhcbspwwtmgueqmpjeqlcswzserveyohbrdlmovnfzcvkygmwutaqaxikamebzpdlzjrggyptwyyeggfyglmazjkneymwrexkyaieexauftvbxsccnzgrxutkkdtqthizgpchheleffmivkbsulfmlxrmxaafpkwhtuyocbuyhhsikmntjihzqgkfcfpuitbtxkemnjulhzluxqajwyglsejavzqzhunokeycmozwjezllicxglwembffzzorijihukzbjbxykcbwpmuimrixvgpzrhnzeuoffebcojfjfppfmwftxurupulcdvboqfpktqjbxslojnltsjhfmokobwxdoclpmzzlqwhbgyiziradtpqifjwmitirvtfgxkqhsrlipyqxtlbsqbpnczmmkjukuatszkgxloangsholoohukumwlfdupnpcwsqhzgajliiglwxadbpxjrmehwnvmkkgrtzgzxcblztgdfhbsrfwlahcxajzyfywbkvmqvokykwpnknuaybqsegjdhvqihdeavqkcuqxkfghxsiwacktzugihdsjcacnuseygxfevybcheqwxvoxvsdtdrhvwggmpbzzkmbtysnrnrgkeorbccmtpxvzteeszbakknjzrpsvpxpmtxcozanbcljmporldzplwmijzoxfsgeblcurmlbtaupgtrvtdnjryezfcpohimovaffldrkzneqbbxdyctujuizwrcvmojasoczmwelofmqewaeylgitegkfcyofzfnulslowbxxegmaexnfeiuloezyhtyoviwsbqrqxrdxieufhgubbzvvzyrarxhkiksfajsdukqrzpfgnjnmzkrklhnuhditivrpiltbasorjvckkwigfeqopgpghclnhjeqxepxnucdaixvxeblbinnelxlikrvcgokifxydsmgnptwuuxrsgkcgklacdhfjuaxtuyssmdngauzykomsucmphpjnvcbyabhjtloksjesfzxdqdfviwlqlqexktbtvqirduzqfzusjilmrmrfmppwoaomfnoodqacakrbusoobcrrbpgqmillwagubnhfqfprpvffnosarkuuchvmmapwowhzmvycjydeeiqhiyfjxrnmvtttuedljulxmwyribkgtvmjngqxrcsboxowqydqbqmicxigbaywvavrdvxfxhnsbpbrlliteiobodmxskeiqfydklqpptevdqkdmivuarkskxpximrxdhyhodewhebvvquxmearzyejrwrwggglmakjgwconamqecslpsjsvaiiddxsckjmlzkertlljyhaxdahqzkkyjbpamahstywjjjmzvmalfqlhipgjmuzeolbpsedglokowgiwafzaolztoibujdplelxpledzzameovpzlabzsaboobwvnlavoutphfgqphvlcfdycgguxlgrxkapwrsjtckanjkutvwqtscfqgpvdukqnyfhtgbifwqrqoomganwhfiodkqrfwqxjotyyktsjjxzipupbkmhysfiodbipkiekxylmpnfvkhtbbsumfrnjuweouqwcxqcvwalomwikxmqclioldsgqkhqflrlztuwztxskfobommabiwodkbfseomexpinmyklelanqkqeszbvwqeyiqrcdfehfnwbfhscevjprazlwgzejdwtfoohoqhbvhfrvvwxqdijpedaevlwsnvbkhiweznmngxcsblvyedfrcfgrhoroflngxltfoyjcugnnqriljgglevpqfetbeuckucpdlbnkfpvzyqtuaijfxpszaxbqgzywitkxgnxdfvglhljrfkurxzgtddecjsiidcsqsssxawexpjxvxatahsypchvnrpefnioypckvpsxdusuphsbyinwnorkmadrwccxaowobcvfodynbtvqjaiqoefisfnljlmgvucsestpfbnpycdjspbqbkiutyvjlsyinumprijofelarewzfzuoadfzciryfdktdhgfuqmkovqhyvylbsgrnzmwprzujcehevxjkloinwkxxvsibzdlzevddsymkdqbatyusenkahddrgjhtwrvlqrtfristochwkbuiuqkbwrgjwvjkerbadqmthvxenkmlwolvqdkqvohcrsznzhhlgqfqgkxwhshzcjgmacwqzlpqkmhbaevuzdcsphtgwsjeaxtnxeldslknxgmepzvvdwsasxmmnjlrgsdhdtrblmtxvkuwkhutvwsrocfdwyrfyatiyypfhcggdoxasezzpllbtcdxuputbmwtmtomusmmhfkzlsrhpjqbfolvdusrpppjxaiqcmntngmiczggzodicisqceszvpjqzylkzgyfyjnzhezhtxjuivagbbmnukjdmrbvftqmhgjydmlymozmrvywvzzneldydvcxvjjtkcphuajrihezhojsmbinbgyswtfvmyipynveqwslcrjjphqttbrnlzkmkgcggtjphfsltxibabnphwcewznzgczqapmiaopzbqzanlycdpvslzmxpicrvgixyavtcsqkwzjprymtnlsszrppkktlpksiuhbuapfsaftwbdnypxtzhgjdrmuxquxzbihcijdpbuyybstxhiwgfwfnemybhwnzehygexpbvexmuzbxqxsgtigsvmsgmkvbjpogkpuzfzqhqkafofqsrzrjtnnbxzpzrapctmkbpecrquzmafbsyfqcszixapmgocewzeixvocetwnwebuqwwxxesasnkzoqvllunsyxktlpqedqnasswqndxzomvxezgpheaidpfojjqppcfqwvfzpzhwumfnlfxpicjpenecrjsscuhisypzwszddfykzyqsthoucjssdcxjukmriasozquypempfswbcwfmqksapkqngkzdedadiiturkalzdyzqctimdxtpjvvxlvdketbzifiqpiuwswrgnzasgbzdlsjsfkffknnbnhlatsrrferwihyteizxsbvbiyxcjbapuyoeectrmhetfpaatrxzwxujkitgagnrnetpurnifjuwsupylwjxfiayzpevtqpcgblzoosqwqzmlsbqizhnmmorzyebczahhdvxgvxcbuavwbqwupeuvgododdnbqtkczmjmcrjwwmhpmkcgcifgkowewzkfxqoqijiqhsqwllvqhqvqwpbxplxaplzkimvpitdgvxfrddugqoepkomsmokkcoutlpwexdcqgdbmaxlryhzcrtejafuljntefnitreyyublfwjwkgllztdsuxcoeilgsbgnlkdyucqrbwobkhfjosljhxumnmakdfnoexewwjzbdthcrvihnejsasrtwisgvfualvoavtnyvxzxdabuetrlyhsmkgatvnljywygnqlzyoxalazrweymbbmfiogwiuwxwmjcnzgeeygkadlwiqaxjnivgdxpuscexeouusygfkjooykqitwwkjxkzfkiavibuaasbruokmqdsrkeffdxuolzzmkpixbudaggdyfdzichcuuchlogjsphazkoemozibwemoorozolizuywbohhpzieivmcvlpxjdzfukyrdnbgnatmhqslqepdtqemfafmhkuxwwsozygmrtktyzyvnobhrjwwnudgrsssgphsvanczqgouwipeaopozcgflzazffnanffheqiddnzuhrtdluhhxwsrgcaoteidrfmobuffgpnqxxjvmriyezpealzmwzrpcczuwlnkymzkvyzzulhvptnkkbrwmzeehhbqboxajcbzmlrhnuqxjkjbbxmsqnyzbykodeelmfvjtpppqapktzwqbrkyihnjrvyqlpmcynxgndcdltorrhkvltdjrayksfrvoixhuyjtlfeourzyecrgtehfesuenvmvxyqptikoepehgupjgzikmznkiehgdgxknhonsqxxlfdqwctpdhouqppskbhskylbhsnourwpkbvtazdkwqlmsamejfqejvzljacijmswudaukusiuccmpkrdgzcqrlxryfhlgdzxgftuhykotqlifnyxvewnlgrutvqfytlordxdlmdgtrgfkblgvwfaeyhdbplikkefsdyrvulknwbhbwmauxznjbfrhamqnygllcbpjynhvioekkxuakbqpdadgfjbadcqpfojftdxurfxitrrixfhgurclquwyugdylfyygkpybjiylklnkpxxzeebeqwcjbwbqqjnxuhhnaofpsixfxabrsbtynhzawbwkpnqfivrodtqkxaglpwjlvpvugbvqlliaoehpagemtnijvwlqpueprhahuvnsumclpabnosfoylgqiuirapxdkfbxdfmkrkhyvvawfanlclplyamtanhcmjdpxzhhgmidemlboorjpotrtpxbymfbzhteawvgiotqkmxqnixbjornfyrnzxmdyregayelgktxjytuhvucdbogsbmjjieojmtrmtxeehyslgasarjejytsrumxopcuxvmmumwijpspkrdowehpibxniiwpsudnfhkmezuevtalynpyxmbmgmvhttfnxgolvoskinzzwjbtkwqtxandqegoubfwyqqqjifbaowikjokjvtwwnuownuitgtrleuoqcmnowwvzmewfkjwwzevnpowntzveyjndwmisiwuwgbetxbzvgabdhgvnmrarkhjagopastwlwxthuafjniwpowerjjeidpnkttnmznsfcchxwxedwndlelxsmvchviuzxxfzvbyrqzynojtphknupmjkrmregzxdzjftknzvtstdmogrbvwctlmdfoadfrawdvjyvyclbfxiwvrdkiftiutxjdksjjzmtvhswyrlqikqgkjdsqtdiqbsirpqcyphmajvvptfxanozvguczoqddoogfxjwdjdadzbyfbawppjmbltvevwgufalcfgoherlghcalpjlepjjbvufyrdcfuqgdccooczyunbwregdnvmmowoimysuskppjctordofrpmwxdutlhyzzxrsrdlqjkmyuoruplpguetysgvznkhnwrlpuvynuoriuzrlnwcoddapghddilkohnsaucxjgjafwbbqmanirdztcbmtffiwankucgywewosoiyllvmavsssvzgjnypselrlmcrtffqxrxiexdtqkqvnwwwpjfoeykrzjhqipfiagpwjgyfkfuakwmozxpzpxlfuihlvjrpqgpuvtvmywxvxbjzqygmysszrgvfaebbhkscspluggfhlmzmvdwtmbikhmikqxxyhesgqbrrwrfccmmfhbithokfyznmkzsmjrxfoefzjguyueccuthsteczuoofwaznkdkzrjzeibkdkirxyypvqhprrhfhgnhpavmdvrkagxshlijoilbadeihojasawdufthkarbhhrdirgccttmclkvifihmllbodomexwjjahjucetgktgvzahzknsyzzhqabwdcggpfsfyplxudtszvjxmkoyfkguadslztsfpygimuvljasfigonoofijxottxakqqtvaucgqbbzzfbrewsbjamflxbumwncksiodtizbmtbgovpyllshoipjccetggrnisldftkqilacbpowkgtsnnonkhewlfyosionsiggwkducnaylebyhrdtsdcsmlapqnrndikagjjcdeihmepssebuuixaitjwennonkxmyszpeeohtbxwqpbysdgcpynlhbykaizigdrjvivrhopbsvfoujthrppczeqcmvkttpbxyqesxysmtnhbfrcbcievirtkxblhtywfrxbanjdzpalfwsiujujknbuzqhxlytttrapmtewkwuhbnfkmgzkunxotoliuljstheekbpgnyvdceyldl
swfsmvtqcpronehlabpwogcgmjxdajcfvgqodvltbpfegtghgpxfgeokdlnfzrnmlcayfkcuswcmtqgwfibskcxaxfepvabhxtt
答案是:
1109046193210863986229601478368414549563750652172204490262538648488493643329082398502376656906626185

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<vector>
#include<cstring>
#include<string>
#include<cmath>
#include <iomanip>
using namespace std;
const int maxn=100;
struct bign
{
    int len,s[maxn];
    bign(){memset(s,0,sizeof(s));len=1;}
    bign operator = (const char *num)
    {
        len=strlen(num);
        for(int i=0;i<len;i++)
        s[i]=num[len-i-1]-'0';
        return *this;
    }
    bign operator = (int num)
    {
        char s[maxn];
        sprintf(s,"%d",num);
        *this=s;
        return *this;
    }
    bign(int num)
    {
        *this =num;
    }
    bign(const char *num)
    {
        *this=num;
    }
    string str() const
    {
        string res="";
        for(int i=0;i<len;i++)
        res=(char)(s[i]+'0')+res;
        if(res=="")
        res="0";
        return res;
    }
    bign operator + (const bign& b) const
    {
        bign c;c.len=0;
        for(int i=0,g=0;g||i<max(len,b.len);i++)
        {
            int x=g;
            if(i<len) x+=s[i];
            if(i<b.len) x+= b.s[i];
            c.s[c.len++]=x%10;
            g=x/10;
        }
        return c;
    }
    bool operator < (const bign& b) const
    {
        if(len!=b.len)
        return len<b.len;
        for(int i=len-1;i>=0;i--)
        if(s[i]!=b.s[i])
        return s[i]<b.s[i];
        return false;
    }
};
istream& operator >>(istream &in,bign& x)
{
    string s;
    in >> s;
    x = s.c_str();
    return in;
}
ostream& operator <<(ostream &out,const bign &x)
{
    out << x.str();
    return out;
}
char s1[10011],s2[101];
bign dp[10011][101];
int main()
{
    ios::sync_with_stdio(false);
    int t;
    cin>>t;
    while(t--)
    {
        memset(dp,0,sizeof(dp));
        cin>>s1>>s2;
        int len1=strlen(s1);
        int len2=strlen(s2);
        for(int i=1;i<=len1;i++)
        {
            if(s1[i-1]==s2[0])
            dp[i][1]=dp[i-1][1]+1;
            else
            {
                if(dp[i][1]<dp[i-1][1])
                dp[i][1]=dp[i-1][1];
            }
        }
        for(int j=2;j<=len2;j++)
        {
            for(int i=1;i<=len1;i++)
            {
                if(s2[j-1]==s1[i-1])
                dp[i][j]=dp[i-1][j-1]+dp[i-1][j];
                else
                {
                    if(dp[i][j]<dp[i-1][j])
                    dp[i][j]=dp[i-1][j];
                }
            }
        }
        cout<<dp[len1][len2]<<endl;
    }
    return 0;
}




思路:
很好的一道动态规划题目,设置s1为长的那个字符串,s2为短的那个字符串,dp[i][j]用来表示s1的前i个字符串里面,有多少s2的前j个字符串。
这里转移方程为
dp[i][j]=dp[i-1][j-1]+dp[i-1][j] (当字符串s1[i-1]==s2[j-1]时) (因为字符串的下标是从0开始,所以i-1)
=max(dp[i][j] ,dp[i-1][j])(s1[i-1]和s2[j-1]不相等)
转移方程的意思最好是自己能在纸上表现出来,实际上会做的题目肯定是会用手算,否则就是蒙出来的,呵呵。
当s1[i-1]与s2[j-1]相等的时候。dp[i-1][j-1]表示的是s1前i-1个字符串里面有多少个s2的前j-1个字符串,此时s1[i-1]与s2[j-1]相等,这里表示在s1中找到了s2中的第j个字母,此得到的是s2中的字母s2[j]为结尾与s1中前i-1个字母里能够形成多少个前s2[0-j]个字符串,(真尼玛绕口)再加上dp[i-1][j]在前面的s1[i-1]个序列中以字母s2[j]为结尾的字符串个数。
当s1[i-1]与s2[j-1]不相等的时候。dp[i][j]记录当前和之前最大的那个数。

例如样例一,s1=babgbag,s2=bag
来张图,便于回忆
uva 10069 Distinct Subsequences 不同的序列_第1张图片

到现在算是完事了?个屁! 看上面给出那数据就知道是大数了,大数模板参考刘汝佳小白书上的那个,很好用哦~~

你可能感兴趣的:(uva 10069 Distinct Subsequences 不同的序列)