DRM Encryption is a new kind of encryption. Given an encrypted string (which we’ll call a DRM
message), the decryption process involves three steps: Divide, Rotate and Merge. This process is
described in the following example with the DRM message “EWPGAJRB”:
Divide — First, divide the message in half to “EWPG” and “AJRB”.
Rotate — For each half, calculate its rotation value by summing up the values of each character
(A = 0, B = 1, . . . Z = 25). The rotation value of “EWPG” is 4 + 22 + 15 + 6 = 47. Rotate each
character in “EWPG” 47 positions forward (wrapping from Z to A when necessary) to obtain the
new string “ZRKB”. Following the same process on “AJRB” results in “BKSC”.
Merge — The last step is to combine these new strings (“ZRKB” and “BKSC”) by rotating each character
in the first string by the value of the corresponding character in the second string. For the first
position, rotating ‘Z’ by ‘B’ means moving it forward 1 character, which wraps it around to ‘A’.
Continuing this process for every character results in the final decrypted message, “ABCD”.
The input file contains several test cases, each of them as described below.
The input contains a single DRM message to be decrypted. All characters in the string are uppercase
letters and the string’s length is even and ≤ 15000.
For each test case, display the decrypted DRM message.
分析：按照题意模拟，另外使用取模别用减法 继续阅读【模拟/字符串】DRM Messages
There is an island called PiLiPaLa.In the island there is a wild animal living in it, and you can call them PuPu. PuPu is a kind of special animal, infant PuPus play under the sunshine, and adult PuPus hunt near the seaside. They fell happy every day. 继续阅读【思维/快速幂】PUPU
33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, …The number n is called a generator of d(n). In the sequence above, 33 is a generator of 39, 39 is a generator of 51, 51 is a generator of 57, and so on. Some numbers have more than one generator: for example, 101 has two generators, 91 and 100. A number with no generators is a self-number. There are thirteen self-numbers less than 100: 1, 3, 5, 7, 9, 20, 31, 42, 53, 64, 75, 86, and 97.
Write a program to output all positive self-numbers less than or equal 1000000 in increasing order, one per line.