Project Euler 79:Passcode derivation
A common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may ask for the 2nd, 3rd, and 5th characters; the expected reply would be: 317.
The text file, keylog.txt, contains fifty successful login attempts.
Given that the three characters are always asked for in order, analyse the file so as to determine the shortest possible secret passcode of unknown length.
网上银行常用的一种密保手段是向用户询问密码中的随机三位字符。例如,如果密码是531278,询问第2、3、5位字符,正确的回复应当是317。
在文本文件keylog.txt中包含了50次成功登陆的正确回复。
假设三个字符总是按顺序询问的,分析这个文本文件,给出这个未知长度的密码最短的一种可能。
思路:
法一:
肉眼看了下:73162890,正确!!! OK
法二:
参考法一
Project Euler 79:Passcode derivation的更多相关文章
- Python练习题 039:Project Euler 011:网格中4个数字的最大乘积
本题来自 Project Euler 第11题:https://projecteuler.net/problem=11 # Project Euler: Problem 10: Largest pro ...
- Python练习题 049:Project Euler 022:姓名分值
本题来自 Project Euler 第22题:https://projecteuler.net/problem=22 ''' Project Euler: Problem 22: Names sco ...
- Python练习题 048:Project Euler 021:10000以内所有亲和数之和
本题来自 Project Euler 第21题:https://projecteuler.net/problem=21 ''' Project Euler: Problem 21: Amicable ...
- Python练习题 047:Project Euler 020:阶乘结果各数字之和
本题来自 Project Euler 第20题:https://projecteuler.net/problem=20 ''' Project Euler: Problem 20: Factorial ...
- Python练习题 046:Project Euler 019:每月1日是星期天
本题来自 Project Euler 第19题:https://projecteuler.net/problem=19 ''' How many Sundays fell on the first o ...
- Python练习题 045:Project Euler 017:数字英文表达的字符数累加
本题来自 Project Euler 第17题:https://projecteuler.net/problem=17 ''' Project Euler 17: Number letter coun ...
- Python练习题 044:Project Euler 016:乘方结果各个数值之和
本题来自 Project Euler 第16题:https://projecteuler.net/problem=16 ''' Project Euler 16: Power digit sum 2* ...
- Python练习题 043:Project Euler 015:方格路径
本题来自 Project Euler 第15题:https://projecteuler.net/problem=15 ''' Project Euler: Problem 15: Lattice p ...
- Python练习题 042:Project Euler 014:最长的考拉兹序列
本题来自 Project Euler 第14题:https://projecteuler.net/problem=14 ''' Project Euler: Problem 14: Longest C ...
随机推荐
- Lucene使用IKAnalyzer分词实例 及 IKAnalyzer扩展词库
文章转载自:http://www.cnblogs.com/dennisit/archive/2013/04/07/3005847.html 方案一: 基于配置的词典扩充 项目结构图如下: IK分词器还 ...
- HMTL5的 video 在IOS7中碰到的坑
直接说问题吧, 测试设备,ipod 我们在移动端播放视频的时候,一般使用H5的video标签,OK,这里有几点差异(就我目前所发现的)给大家分享一下, 1.在IOS7中,video元素是需要确定大小的 ...
- MongoDB的常用命令
[转]http://blog.csdn.net/ithomer/article/details/17111943 mongodb由C++编写,其名字来自humongous这个单词的中间部分,从名字可见 ...
- QQ好友列表向左滑动出现置顶、删除--第三方开源--SwipeMenuListView
SwipeMenuListView是在github上的第三方开源项目,该项目在github上的链接地址是:https://github.com/baoyongzhang/SwipeMenuListVi ...
- Django之Model(一)--基础篇
0.数据库配置 django默认支持sqlite,mysql, oracle,postgresql数据库.Django连接数据库默认编码使用UTF8,使用中文不需要特别设置. sqlite djang ...
- Nginx+uWSGI+Django原理
Python的Web开发中,如果使用Django框架,那么较为成熟稳定的服务器架构一般是Nginx+uWSGI+Django.而为什么一定要三个结合在一起呢?直接使用Django的runserver来 ...
- IE6和IE7的line-height和现代浏览器不一致的问题
1.我们发现在网页中设置line-height后,现代浏览器显示正常,可是在IE6 IE7下却不能正确解析,这时需要再额外的为旧版浏览器声明: p{ line-height: 30px; *line- ...
- WPF 界面控件遍历和后台行为绑定写法
InvokeCommandAction ic = new InvokeCommandAction(); ic.Command = tree.SelectedItemCommand;//绑定的命令 ic ...
- PAT IO-02 整数四则运算
/* *PAT IO-02 整数四则运算 *2015-07-30 *作者:flx413 */ #include<stdio.h> int main() { int a, b; scanf( ...
- 信息传递--NOIP2015 day1 T2--暴力
这道题我用了判联通量加暴力,但联通量判炸了....然后从code[VS]上看到个不错的代码,就拿来了^_^... 基本思路是去掉环外的点,然后走每一个联通块. #include <iostrea ...