HDUOJ--1865 1string
1sting
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2372 Accepted Submission(s): 947
#include<iostream>
#include<string>
#define maxn 50
#define len 200
using namespace std;
int arr[len][maxn+]={{},{}};
int main()
{
int i,j,s,c,t;
string n ;
for(i=;i<=len;i++)
{
for(c=j=;j<=maxn;j++)
{
s=arr[i-][j]+arr[i-][j]+c;
arr[i][j]=s%;
c=(s-arr[i][j])/;
}
}
cin>>t;
while(t--)
{
cin>>n;
for(i=maxn;arr[n.size()][i]==;i--);
for(j=i;j>=;j--)
{
printf("%d",arr[n.size()][j]);
}
puts("");
}
return ;
}
HDUOJ--1865 1string的更多相关文章
- HDU - 1865 1string(大数)
题目链接:http://acm.hust.edu.cn/vjudge/contest/121397#problem/F http://acm.hdu.edu.cn/showproblem.php?pi ...
- hduoj 1455 && uva 243 E - Sticks
http://acm.hdu.edu.cn/showproblem.php?pid=1455 http://uva.onlinejudge.org/index.php?option=com_onlin ...
- hduoj 4712 Hamming Distance 2013 ACM/ICPC Asia Regional Online —— Warmup
http://acm.hdu.edu.cn/showproblem.php?pid=4712 Hamming Distance Time Limit: 6000/3000 MS (Java/Other ...
- hduoj 4706 Herding 2013 ACM/ICPC Asia Regional Online —— Warmup
hduoj 4706 Children's Day 2013 ACM/ICPC Asia Regional Online —— Warmup Herding Time Limit: 2000/1000 ...
- hdu-oj 1874 畅通工程续
最短路基础 这个题目hdu-oj 1874可以用来练习最短路的一些算法. Dijkstra 无优化版本 #include<cstdio> #include<iostream> ...
- C#版 - HDUoj 5391 - Zball in Tina Town(素数) - 题解
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. HDUoj 5 ...
- C++版 - HDUoj 2010 3阶的水仙花数 - 牛客网
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. C++版 - ...
- HDUOJ题目HTML的爬取
HDUOJ题目HTML的爬取 封装好的exe/app的GitHub地址:https://github.com/Rhythmicc/HDUHTML 按照系统选择即可. 其实没什么难度,先爬下来一个题目的 ...
- hduoj题目分类
基础题:1000.1001.1004.1005.1008.1012.1013.1014.1017.1019.1021.1028.1029.1032.1037.1040.1048.1056.1058.1 ...
随机推荐
- [Android Pro] AtomicInteger的用法
J2SE 5.0提供了一组atomic class来帮助我们简化同步处理.基本工作原理是使用了同步synchronized的方法实现了对一个long, integer, 对象的增.减.赋值(更新)操作 ...
- UNIX域套接字——UNIX domain socket(DGRAM)
#define UNIX_PATH_MAX 108 #include <sys/types.h> #include <sys/socket.h> #include <sy ...
- 第2章 排序 | 第10节 计数排序练习题 && 基数排序
对于一个int数组,请编写一个计数排序算法,对数组元素排序. 给定一个int数组A及数组的大小n,请返回排序后的数组. 测试样例: [1,2,3,5,2,3],6 [1,2,2,3,3,5] 计数排序 ...
- 图片文字OCR识别-tesseract-ocr
帮助文件:https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc 下载地址:https://github. ...
- ItemsControl
<ItemsControl Grid.Row=" ItemsSource="{Binding Content.patientInfoList}" Width=&qu ...
- 敏捷方法之极限编程(XP)和 Scrum区别
敏捷(Agile)作为一种开发流程, 目前为各大公司所采用, 敏捷流程的具体实践有XP 和Scrum, 似乎很少有文章介绍这两者的区别, 发现一篇外文, 见解非常深刻, 特将其翻译一把. 原文(DIF ...
- Learning How To Code Neural Networks
原文:https://medium.com/learning-new-stuff/how-to-learn-neural-networks-758b78f2736e#.ly5wpz44d This i ...
- [Functional Programming] Build a Linear congruential generator
What we are going to do in this post, is to build a random number generator. As you might know that ...
- [Android] Content provider, ContentResolver
Content provider的作用: Content providers manage access to a structured set of data. They encapsulate t ...
- #lspci | grep Eth
该命令作用:将lspci的输出当做输入,从中找出包含Eth的行.在我的Fedora机器上运行结果为 [root@localhost etc]# lspci | grep Eth00:04.0 Ethe ...