沐枫NOI 21. Restoring Password
来源:互联网 发布:贪吃蛇java小游戏代码 编辑:程序博客网 时间:2024/05/22 02:23
Igor K. always used to trust his favorite Kashpirovsky Antivirus. That is why he didn't hesitate to download the link one of his groupmates sent him via QIP Infinium. The link was said to contain "some real funny stuff about swine influenza". The antivirus had no objections and Igor K. run the flash application he had downloaded. Immediately his QIP Infinium said: "invalid login/password".
Igor K. entered the ISQ from his additional account and looked at the info of his main one. His name and surname changed to "H1N1" and "Infected" correspondingly, and the "Additional Information" field contained a strange-looking binary code 80 characters in length, consisting of zeroes and ones. "I've been hacked" − thought Igor K. and run the Internet Exploiter browser to quickly type his favourite search engine's address.
Soon he learned that it really was a virus that changed ISQ users' passwords. Fortunately, he soon found out that the binary code was actually the encrypted password where each group of 10 characters stood for one decimal digit. Accordingly, the original password consisted of 8 decimal digits.
Help Igor K. restore his ISQ account by the encrypted password and encryption specification.
Input
The input data contains 11 lines. The first line represents the binary code 80 characters in length. That is the code written in Igor K.'s ISQ account's info. Next 10 lines contain pairwise distinct binary codes 10 characters in length, corresponding to numbers 0, 1, ..., 9.
Output
Print one line containing 8 characters − The password to Igor K.'s ISQ account. It is guaranteed that the solution exists.
Examples
Input
010011001001011000000101100010010110010001011001100101101000010110101001011011000100110000010011001001011000000101100010010110010001011001100101101000010110101001011011000101101110
Output
12345678
Input
101011011110010000101001000110101011011100101101110110001000110111100101100010001001000010110111100110010001101010110111001011011111010011011011000001111001010110110110000110001000
Output
30234919
#include<iostream>#include<cstdio>#include<algorithm>#include<vector>#include<set>#include<queue>#include<cstring>#include<map>using namespace std;int main(){string str;cin>>str;map<string,int> m;for(int i=0;i<10;i++){string fz;cin>>fz;m[fz]=i;}for(int i=0;i<80;i+=10){string fz=str.substr(i,10);cout<<m[fz];}return 0;}
- 沐枫NOI 21. Restoring Password
- A. Restoring Password
- A. Restoring Password
- CF:94A. Restoring Password
- 【substr】#76 A. Restoring Password
- Codeforces 94A-Restoring Password
- 沐枫NOI 10. Leaders
- 沐枫NOI 14. Football
- 沐枫NOI 17. Volleyball
- 沐枫NOI 28. Queue
- NOI
- Restoring Numbers
- Restoring Painting
- 沐枫NOI 25. Binary Number
- 沐枫NOI 30. African Crossword
- 沐枫NOI 2839. 单词替换
- password
- password
- Linux 下 mysql 的安装 (编译源码的方式)
- Android 源码解析之WindowManager删除窗口
- jq中三种显示及隐藏方法
- lnmp “.user.ini”无法删除解决方法
- 两个变量交换的三种方法
- 沐枫NOI 21. Restoring Password
- 数据分析的统计学基础-假设检验
- Spring+SpringMVC+Mybatis+mysql整合详解
- 如何制作Ubuntu安装U盘
- HTML和CSS实例讲解
- List.clear方法——从列表中移除所有元素
- 实验7 MapReduce-计数器
- 沐枫NOI 25. Binary Number
- 何为分布式、微服务和集群!