GCJ Qualification Round D

Source: Internet
Author: User

The problem is to find the law. Small data is pretty easy to think about. Big data has to be analyzed in more depth.

The test instructions is quite round.

is actually a string conversion. The string can only have two letters, l or G. Given K and C, the target string can be generated from the rule.

So, if you know the K and C, and the target string, then you can roll out the original string.

Now the problem is, the target string is not all for you to see, limit you to see the most S. However, it does not require you to completely pour out the original string, but only to know that the original string is not at least a G character can be.

The small data is extremely simple, for what, because S=k, and see the s target string character can completely pour out the original string ah.

Because the 1th character of the original string will be the 1th character of the target string, the 2nd character of the original string will be the first k+2 character of the target string, and the 3rd character of the original string will be the 2*k+3 character of the target string ...

However, just to know if there is at least one G character in the original string, there is no need to see so much. Then continue the analysis.

GCJ Qualification Round D

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.