#define LOCAL0
#include <stdlib.h>
#include <stdio.h>
#include "iostream"
#include "sstream"
#include <string.h>
#include <cmath>
#define inf 0x3f3f3f3f
using namespace std;
char tbl[8][(1<<7)-1];
int getCode(char *s, int &pos, int len)
{
int tot=0;
char ch;
while(len){
ch=s[pos++];
tot=tot+(ch-'0')*int(pow(2,len-1));
--len;
}
return tot;
}
int main()
{
#ifdef LOCAL
freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
#endif
int i,n,ch;
memset(tbl,0,sizeof(tbl));
for(i=1;i<8;i++){
for(n=0;n<int(pow(2,i)-1);n++){
if((ch=getchar())!='\n')
tbl[i][n]=ch;
else break;
}
if(ch=='\n') break;
}
int l,pos=0,k;
char s[1024];
scanf("%s",s);
while((l=getCode(s,pos,3))!=0){
while((k=getCode(s,pos,l))!=int(pow(2,l)-1)){
cout<<tbl[l][k];
}
putchar('\n');
}
printf("END\n");
return 0;
}
UVa213
最新推荐文章于 2022-02-22 10:21:28 发布