UVa213-Message Decoding
来源:互联网 发布:维护数据库培训班 编辑:程序博客网 时间:2024/06/05 14:12
UVa213-Message Decoding
思路:
紫书上的题目刚开始没有把各个功能独立开来能想到的例子都过了但是提交就RE,卡了巨长时间最后无奈按照书上思路把各个功能独立出来,一边过。无奈
代码:
#include <bits/stdc++.h>using namespace std;char ve[8][1<<9+1];char getcha(){ int ch; while(ch=getchar()) { if(ch!='\n'&&ch!='\t') return ch; }}int getnum(int n){ int num=0; while(n--) num=num*2+getcha()-'0'; return num;}int gethead(){ char ch[100001]; int k=0; memset(ve,0,sizeof(ve)); if(scanf("%[^\n]",ch)==-1) return 0; for(int i=1;;i++) { for(int j=0;j<(1<<i)-1;j++,k++) { if(!ch[k]) return 1; ve[i][j]=ch[k]; } } return 1;}int main(){ int n; while(gethead()) { while(n=getnum(3),n) { int ans; while(1) { ans=getnum(n); if(ans==(1<<n)-1)break; printf("%c",ve[n][ans]); } } printf("\n"); getchar(); }}
阅读全文
0 0
- UVA213 - Message Decoding
- UVa213 Message Decoding
- UVa213 - Message Decoding
- UVA213----Message Decoding
- UVA213 UVALive5152 Message Decoding
- UVa213-Message Decoding
- UVa213 Message Decoding
- UVa213 Message Decoding
- UVA213 Message Decoding(二进制)
- 水题:UVa213- Message Decoding
- 算法竞赛入门经典 UVa213 Message Decoding
- Message Decoding
- Message Decoding
- 算法竞赛入门经典(第二版) 例题4-4 信息编码(Message Decoding) UVa213 Finals1991 (二进制)
- uva -213Message Decoding
- UVa 213 - Message Decoding
- UVaOJ-213 Message Decoding
- UVA【213】 Message Decoding
- centos7 mysql数据库安装和配置
- QT qt5使用qdebug()输出中文 乱码
- 检索框的实现
- 最全面的Java多线程用法解析
- 稀疏自编码
- UVa213-Message Decoding
- Foxit MobilePDF SDK_如何快速创建一个功能丰富的PDF 阅读器
- C#详解值类型和引用类型区别
- oracle 视图
- 搭建Lua开发环境
- 技术文章 | JavaScript与PHP到底有何不同?
- 怎么在游戏里制作出一张合格的720全景
- 关于安卓保存网络图片并更新图库
- USACO Section 1.5 Prime Palindromes