Climbing Worm

简介: http://acm.hdu.edu.cn/showproblem.php?pid=1049 1 #include 2 using namespace std; 3 int main() 4 { 5 int n,u,d,s,t; 6 while (cin...

http://acm.hdu.edu.cn/showproblem.php?pid=1049

 1 #include <iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int n,u,d,s,t;
 6     while (cin >> n >> u >> d)
 7     {
 8         if (n==0)
 9             return 0;
10         else
11         {
12             s=0;
13             t=0;
14             while (s+u<n)
15             {
16                 s+=u-d;
17                 t+=2;
18             }
19             t+=1;
20             cout << t << endl;
21         }
22     }
23     return 0;
24 }

 

 

img_e00999465d1c2c1b02df587a3ec9c13d.jpg
微信公众号: 猿人谷
如果您认为阅读这篇博客让您有些收获,不妨点击一下右下角的【推荐】
如果您希望与我交流互动,欢迎关注微信公众号
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

目录
相关文章
|
Ubuntu 应用服务中间件 Shell
IChunQiu云境-Spoofing Writeup(一)
Tag: Tomcat,NTLM,WebClient,Coerce Authentication,noPac
|
SQL Web App开发 Oracle
Ichunqiu云境 —— Endless(无间计划) Writeup
两个入口点,一个入口点是pboot-cms,另外一个是SQL注入
AtCoder Beginner Contest 133 E - Virus Tree 2(组合数学)
AtCoder Beginner Contest 133 E - Virus Tree 2(组合数学)
83 0
|
人工智能
atcoder AtCoder Beginner Contest 210 D - National Railway(dp)
atcoder AtCoder Beginner Contest 210 D - National Railway(dp)
92 0
|
前端开发 网络架构
HDU-1049 Climbing Worm
HDU-1049 Climbing Worm
|
Shell PHP 数据安全/隐私保护
noxCTF部分writeup(欢迎吐槽QAQ)
前言 本文首发i春秋:https://bbs.ichunqiu.com/thread-46059-1-1.html 渣渣一枚,萌新一个,会划水,会喊六六(hhhhh) 补一下关于noxCTF中的部分解题思路,毕竟自己太渣(Qrz),有些题目还是做不出来(QAQ),有什么错误的地方,希望各位大佬指点...
1425 0
1013. Battle Over Cities (25)
//连通分量数量 - 1 //如何求连通分量: #include #include #include #include using namespace std; int e[1000][1000], n; bool ...
765 0
1061. Dating (20)
Sherlock Holmes received a note with some strange strings: "Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm".
818 0