{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp\u003eAlice and Bob need to send secret messages to each other and are discussing ways to encode their\r\nmessages:\u003c/p\u003e\r\n\u003cblockquote\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eAlice:\u003c/u\u003e “Let’s just use a very simple code: We’ll assign ‘A’ the code word 1, ‘B’ will be 2,\r\n\tand so on down to ‘Z’ being assigned 26.”\u003cbr\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eBob:\u003c/u\u003e “That’s a stupid code, Alice. Suppose I send you the word ‘BEAN’ encoded as 25114.\r\n\tYou could decode that in many different ways!”\u003cbr\u003e\r\n\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eAlice:\u003c/u\u003e “Sure you could, but what words would you get? Other than ‘BEAN’, you’d get\r\n\t‘BEAAD’, ‘YAAD’, ‘YAN’, ‘YKD’ and ‘BEKD’. I think you would be able to figure out the\r\n\tcorrect decoding. And why would you send me the word ‘BEAN’ anyway?”\u003cbr\u003e\r\n\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eBob:\u003c/u\u003e “OK, maybe that’s a bad example, but I bet you that if you got a string of length 5000\r\n\tthere would be tons of different decodings and with that many you would find at least two\r\n\tdifferent ones that would make sense.”\u003cbr\u003e\r\n\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eAlice:\u003c/u\u003e “How many different decodings?”\u003cbr\u003e\r\n\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cu\u003eBob:\u003c/u\u003e “Jillions!”\r\n\u003c/p\u003e\r\n\u003c/blockquote\u003e\r\n\u003cp\u003e\r\nFor some reason, Alice is still unconvinced by Bob’s argument, so she requires a program that will\r\ndetermine how many decodings there can be for a given string using her code.\u003c/p\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp\u003eInput will consist of multiple input sets. Each set will consist of a single line of at most 5000 digits representing a\r\nvalid encryption (for example, no line will begin with a 0). There will be no spaces between the digits.\r\nAn input line of ‘0’ will terminate the input and should not be processed.\u003c/p\u003e\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp\u003eFor each input set, output the number of possible decodings for the input string. All answers will be\r\nwithin the range of a 64 bit signed integer.\u003c/p\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\r\n\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e25114\r\n1111111111\r\n3333333333\r\n0\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e6\r\n89\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\n\u003c/div\u003e"}}]}