UVALive 4998 Simple Encryption】的更多相关文章

题意: 给出K1,求一个12位数(不含前导0)K2,使得K1^K2 mod (10^12) = K2. 解法: 求不动点问题. 有一个性质: 如果12位数K2满足如上式子的话,那么K2%1,K2%10,K2%100,...,K2%10^12都会满足如上式子.那么我们可以dfs从后往前一个一个找出这个数的每一位. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cstdli…
题目描述: 输入正整数K1(K1<=5000),找一个12位正整数K2使得K1K2=K2(mod 1012). 解题思路: 压缩映射原理:设X是一个完备的度量空间,映射ƒ:Χ→Χ 把每两点的距离至少压缩λ倍,即d(ƒ(x),ƒ(y))≤λd(x,y),这里λ是一个小于1的常数,那么ƒ必有而且只有一个不动点,而且从Χ的任何点x0出发作出序列x1=ƒ(x0),x2=ƒ(x1),...,xn=ƒ(x(n-1)),...,这序列一定收敛到那个不动点. 题目要求解的方程形式是f(K2)=K2,很直接地就想…
题意:输入正整数$K_1(K_1 \leq 50000)$, 找一个$12$位正整数$K_2$(不能含有前导零)使得${K_1}^{K_2}\equiv K_2(mod10^{12})$. 例如,$K_1=78$和$99$时,$K_2$分别为$308646916096$和$817245479899$. 分析:这题还是需要搜索来寻找答案的,直接构造很困难.事实上,${K_1}^{K_2}\equiv K_2(mod10^{12})$,同时意味着: ${K_1}^{K_2}\equiv K_2(mo…
题目链接:uva 12253 - Simple Encryption 题目大意:给定K1.求一个12位的K2,使得KK21=K2%1012 解题思路:按位枚举,不且借用用高速幂取模推断结果. #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long ll; const ll ite=(1<<20)-1; ll N; /* l…
Unique Encryption Keys 题目链接: http://acm.hust.edu.cn/vjudge/problem/26633 Description http://7xjob4.com1.z0.glb.clouddn.com/bced90d15c27e75270cc759651dcfa63 Input The input contains several cipher descriptions. Each description starts with one line co…
这题到现在还是只有我一个人过?太冷门了吧,毕竟你谷上很少有人会去做往年ACM比赛的题 题面意思很简单,每次给出\(K_1\),让你求一个\(K_2\)满足\(K_1^{K_2}\equiv K_2(\mod 10^{12})\) 题目乍一看很有数学风格,看到取模和幂次想到什么? 费马大小定理,BSGS,二次探测?,不过在这里好像都用不了啊. 所以我们先考虑一个最朴素的想法:爆搜,每次直接枚举每一位上放什么数字,然后快速幂判断. 这样肯定T飞啊,所以我们进行一个大力观察,我们手玩下第二个样例: \…
Refer to http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/x64.html The content 1.2. What is SSL and what are Certificates? The Secure Socket Layer protocol was created by Netscape to ensure secure transactions between web servers and browsers. The pr…
问题 J: Progressive Scramble 时间限制: 1 Sec  内存限制: 128 MB 提交: 108  解决: 45 [提交] [状态] [命题人:admin] 题目描述 You are a member of a naive spy agency. For secure communication,members of the agency use a very simple encryption algorithm – which changes each symbol…
Do the Untwist Time Limit: 2 Seconds      Memory Limit: 65536 KB Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the ciphertext will be able…
ZOJ Problem Set - 1006 Do the Untwist Time Limit: 2 Seconds      Memory Limit: 65536 KB Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the…