http://codeforces.com/contest/94
A
1 #include<bits/stdc++.h> 2 using namespace std; 3 #define lson l,mid,rt<<1 4 #define rson mid+1,r,rt<<1|1 5 #define sqr(x) ((x)*(x)) 6 #define pb push_back 7 #define eb emplace_back 8 #define maxn 200005 9 #define eps 1e-8 10 #define pi acos(-1.0) 11 #define rep(k,i,j) for(int k=i;k<j;k++) 12 typedef long long ll; 13 typedef pair<int,int> pii; 14 typedef pair<char,int> pci; 15 typedef pair<pair<int,string>,pii> ppp; 16 typedef unsigned long long ull; 17 const long long MOD=1e9+9; 18 /*#ifndef ONLINE_JUDGE 19 freopen("1.txt","r",stdin); 20 #endif */ 21 22 23 string s[15]; 24 string s1[15]; 25 26 int main(){ 27 #ifndef ONLINE_JUDGE 28 // freopen("1.txt","r",stdin); 29 #endif 30 std::ios::sync_with_stdio(false); 31 string str; 32 cin>>str; 33 for(int i=0;i<10;i++){ 34 cin>>s[i]; 35 } 36 for(int i=0;i<8;i++){ 37 for(int j=0;j<10;j++){ 38 s1[i]+=str[i*10+j]; 39 } 40 } 41 for(int i=0;i<8;i++){ 42 for(int j=0;j<10;j++){ 43 if(s1[i]==s[j]){ 44 cout<<j; 45 break; 46 } 47 } 48 } 49 }