hdu Problem-5703
来源:互联网 发布:淘宝一点通是什么 编辑:程序博客网 时间:2024/05/21 10:34
Desert
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 1126 Accepted Submission(s): 803
Problem Description
A tourist gets lost in the desert with n liters of water. He drinks positive integer units of water each day.
Write a program to calculate how many different ways the tourist can drink up the water.
Write a program to calculate how many different ways the tourist can drink up the water.
Input
The first line contains the number of test cases T(T≤10) .
NextT lines contain the number n(1≤n≤1000000) for each test case.
Next
Output
Output consists of T lines.
Each line contains the binary number which represents number of different ways to finish up the water specified in the test case.
Each line contains the binary number which represents number of different ways to finish up the water specified in the test case.
Sample Input
13
Sample Output
100Hint3 liters of water can be comsumed in four different ways show in the following. 1. 1 1 1 2. 1 2 3. 2 1 4. 3 If we write 4 in binary, it's 100.
//思路:找规律
AC源码:
#include <iostream>using namespace std;int main(){int T,n;cin>>T;while(T--){cin>>n;cout<<"1";while(--n)cout<<"0";cout<<endl;}return 0;}
阅读全文
0 0
- hdu Problem-5703
- HDU-PROBLEM
- HDU Problem A
- HDU 3549 Flow Problem
- HDU problem 3877
- HDU Train Problem II
- HDU 1005 Problem Description
- HDU 1534 Schedule Problem
- hdu 3549 Flow Problem
- hdu 3549 Flow Problem
- HDU 1001 Sum Problem
- hdu 3374 String Problem
- HDU 1016 PrimeRing Problem
- HDU--1001--Sum Problem
- hdu Train Problem II
- hdu 1001 Sum Problem
- hdu A + B problem
- HDU Problem B
- 神经网络浅讲:从神经元到深度学习
- java原理函数之获取数组的最大值
- 大数据,云计算学习路线
- C++函数返回指针结果的坑.
- Spring Cloud构建微服务架构(七)消息总线(续:Kafka)
- hdu Problem-5703
- POJ 1984 Navigation Nightmare
- linux常用指令大全
- 丑陋的字符串
- bbed之一 ------bbed的编译
- 从零学java笔录-第16篇 循环语句总结&break
- [精华分享][Unity&模型制作&blender]适合独立游戏开发的官方免费3D人物模型软件以及教程合集
- Android-------使用第三方Banner实现对网络图片的无线轮播
- 307. Range Sum Query