Codeforces//Good Bye 2013//A. New Year Candles 水题
第一次在Codeforces上提交题,全是英文,啊。应该是场比赛,WA了两次,丫的。哎,什么时候才能不做水题了呢。Happy New Year!Zhou Ping!努力奋斗!
题目链接:A. New Year Candles
题目大意:输入两个数a和b,用b个燃烧完的蜡烛可以换一个新的蜡烛,以此类推。
比如一共有4个蜡烛,2个蜡烛可以换一个新的蜡烛。4个蜡烛可以换2个新的蜡烛,2个新蜡烛燃烧后仍可以换1个蜡烛,所以一共可以燃烧4+2+1=7个蜡烛。
例: 4 2 4/2 2 2/2 1 例: 6 3 6/3 2 一直到余数小于b结束。
# include <stdio.h>
int main()
{int a,b,c=0,num=0;scanf("%d %d",&a,&b);while(1){num=num+a;c=c+a;a=c/b;if(c<b)break;c=c%b;}printf("%d\n",num);return 0;
}
Codeforces//Good Bye 2013//A. New Year Candles 水题相关推荐
- Codeforces Round #352 (Div. 2) A. Summer Camp 水题
A. Summer Camp 题目连接: http://www.codeforces.com/contest/672/problem/A Description Every year, hundred ...
- Codeforces Codeforces Round #319 (Div. 2) A. Multiplication Table 水题
A. Multiplication Table Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/57 ...
- Educational Codeforces Round 9 A. Grandma Laura and Apples 水题
A. Grandma Laura and Apples 题目连接: http://www.codeforces.com/contest/632/problem/A Description Grandm ...
- Codeforces Round #277 (Div. 2) A. Calculating Function 水题
A. Calculating Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/4 ...
- 【CodeForces - 1150A】Stock Arbitraging (贪心,水题)
题干: Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on ...
- Codeforces Round #360 (Div. 2) C. NP-Hard Problem 水题
C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari ...
- Codeforces Round #322 (Div. 2) B. Luxurious Houses 水题
B. Luxurious Houses Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/pr ...
- CodeForces - 3A Shortest path of the king【水题】
[题目描述] The king is left alone on the chessboard. In spite of this loneliness, he doesn't lose heart, ...
- Codeforces 439A, the Singer and Churu, the Joker(水题)
题目链接:Codeforces 439A Devu, the Singer and Churu, the Joker 题目大意:Devu是一个歌唱家,Churu是个小丑,他们被共同邀请参加一个表演秀, ...
最新文章
- 《Advanced PHP Programming》读书笔记
- Java匿名内部类总结
- java实现多级菜单(java递归)方法二
- 带孩子们做环球旅行的读后感_父母带孩子做心理咨询,需要注意哪些事项?
- php字符串反转abcdefg_php中实现字符串翻转的方法
- 【快速安装Docker服务及Docker配置、Docker常用命令。】
- 数据创建表 修改列 新增列
- Android之Adapter总结
- C# NFine开源框架 调用存储过程的实现代码
- c# lu分解的代码_线性方程组的分解法——LU分解法
- tem_search_shop-获得店铺的所有商品
- 2022保安员(初级)考试题库及模拟考试
- 如何在家打造一个沉浸式的家庭影院呢?
- 翻译来自HiDDeN网络架构-Lifeifei
- java公社博客_Java
- 一个骨灰级玩家的游戏加速器使用心得分享
- DDS的DXT5格式解析
- 递归入门(C语言实现)
- 香港必理痛儿童退烧止痛药水 用量详解 (Panadol)
- 暗黑破坏神练Key方法详解