CF630L.Cracking the Code
普及/提高-
通过率:0%
时间限制:0.50s
内存限制:64MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The protection of a popular program developed by one of IT City companies is organized the following way. After installation it outputs a random five digit number which should be sent in SMS to a particular phone number. In response an SMS activation code arrives.
A young hacker Vasya disassembled the program and found the algorithm that transforms the shown number into the activation code. Note: it is clear that Vasya is a law-abiding hacker, and made it for a noble purpose — to show the developer the imperfection of their protection.
The found algorithm looks the following way. At first the digits of the number are shuffled in the following order
Vasya is going to write a keygen program implementing this algorithm. Can you do the same?
某家IT城市公司开发的一款热门程序,其保护机制设计如下:安装后,程序会显示一个随机的五位数,用户需将该数字通过短信发送至指定手机号码,随后即可收到一条包含激活码的短信回复。
一位年轻的黑客瓦夏(Vasya)反编译了该程序,并找到了将显示的数字转换为激活码的算法。注意:显然,瓦夏是一位遵纪守法的黑客,他此举出于高尚的目的——向开发者揭示其保护机制的缺陷。
该算法的具体步骤如下:
第一步,对原五位数的各位数字按如下顺序重排:<第一位><第三位><第五位><第四位><第二位>。例如,对 12345 进行重排后得到 13542。
第二步,将重排后所得数字进行五次方运算。以 12345 为例,其重排结果为 13542,而 135425=455422043125550171232。最终答案取该幂运算结果的末五位数字。因此,对于输入 12345,答案应为 71232。
瓦夏计划编写一个实现该算法的密钥生成器(keygen)程序。你能否也实现一个?
输入格式
The only line of the input contains a positive integer five digit number for which the activation code should be found.
输入仅包含一行,为一个五位正整数,需要为其找出激活码。
输出格式
Output exactly 5 digits without spaces between them — the found activation code of the program.
精确输出 5 位数字,数字之间不加空格——即程序的激活码。
输入输出样例
输入#1
12345
输出#1
71232
输入解题思路,AI测评打分。不知道怎么写?