UVA 712(p176)----S-Trees
来源:互联网 发布:115会员淘宝不卖了 编辑:程序博客网 时间:2024/06/10 18:10
#include<bits/stdc++.h>#define debuusing namespace std;int v[10],n,m;string lf;char solve(string st){ int d=1; for(int i=0; i<n; i++) if(st[v[i]]=='0') d*=2; else d=d*2+1; return lf[d-(1<<n)];}int main(){#ifdef debug freopen("in.in","r",stdin);#endif // debug int cas=0; string tmp; while((cin>>n)&&n) { cout<<"S-Tree #"<<++cas<<":\n"; for(int i=0; i<n; i++) { cin>>tmp; v[i]=tmp[1]-'1'; } cin>>lf>>m; for(int i=0; i<m; i++) { cin>>tmp; cout<<solve(tmp); } cout<<"\n\n"; } return 0;}题目地址:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=653
0 0
- UVA 712(p176)----S-Trees
- UVa 712 S-Trees
- UVa 712 - S-Trees
- Uva 712 S-Trees
- uva 712 - S-Trees
- uva 712 - S-Trees
- UVa 712 - S-Trees
- UVA 712 S-Trees
- uva-712 S-Trees
- uva 712-S-Trees
- UVA 712 S-Trees
- uva 712 S-Trees
- uva 712 S-Trees
- UVa 712 - S-Trees
- UVA 712 - S-Trees
- UVA 712 S-Trees
- UVA 712 S-Trees
- UVA - 712 S-Trees
- 几种TCP连接中出现RST的情况
- UVA 699(p159)----The Falling Leaves
- MFC绘制动态曲线,用双缓冲绘图技术防闪烁
- vector中erase用法注意事项
- C语言的整型和长整型的字节长
- UVA 712(p176)----S-Trees
- 自定义ViewGroup——卫星式菜单的实现
- hdu 1551(二分)
- 大龄恐惧症 (zz)
- 随堂笔记160225表达式
- UML类图几种关系的总结
- 学长的训诫C++
- Servlet_03_ServletConfig
- 操作系统----内存管理