第一次在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 水题相关推荐

  1. Codeforces Round #352 (Div. 2) A. Summer Camp 水题

    A. Summer Camp 题目连接: http://www.codeforces.com/contest/672/problem/A Description Every year, hundred ...

  2. 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 ...

  3. Educational Codeforces Round 9 A. Grandma Laura and Apples 水题

    A. Grandma Laura and Apples 题目连接: http://www.codeforces.com/contest/632/problem/A Description Grandm ...

  4. Codeforces Round #277 (Div. 2) A. Calculating Function 水题

    A. Calculating Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/4 ...

  5. 【CodeForces - 1150A】Stock Arbitraging (贪心,水题)

    题干: Welcome to Codeforces Stock Exchange! We're pretty limited now as we currently allow trading on ...

  6. Codeforces Round #360 (Div. 2) C. NP-Hard Problem 水题

    C. NP-Hard Problem 题目连接: http://www.codeforces.com/contest/688/problem/C Description Recently, Pari ...

  7. 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 ...

  8. 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, ...

  9. Codeforces 439A, the Singer and Churu, the Joker(水题)

    题目链接:Codeforces 439A Devu, the Singer and Churu, the Joker 题目大意:Devu是一个歌唱家,Churu是个小丑,他们被共同邀请参加一个表演秀, ...

最新文章

  1. 《Advanced PHP Programming》读书笔记
  2. Java匿名内部类总结
  3. java实现多级菜单(java递归)方法二
  4. 带孩子们做环球旅行的读后感_父母带孩子做心理咨询,需要注意哪些事项?
  5. php字符串反转abcdefg_php中实现字符串翻转的方法
  6. 【快速安装Docker服务及Docker配置、Docker常用命令。】
  7. 数据创建表 修改列 新增列
  8. Android之Adapter总结
  9. C# NFine开源框架 调用存储过程的实现代码
  10. c# lu分解的代码_线性方程组的分解法——LU分解法
  11. tem_search_shop-获得店铺的所有商品
  12. 2022保安员(初级)考试题库及模拟考试
  13. 如何在家打造一个沉浸式的家庭影院呢?
  14. 翻译来自HiDDeN网络架构-Lifeifei
  15. java公社博客_Java
  16. 一个骨灰级玩家的游戏加速器使用心得分享
  17. DDS的DXT5格式解析
  18. 递归入门(C语言实现)
  19. 香港必理痛儿童退烧止痛药水 用量详解 (Panadol)
  20. 暗黑破坏神练Key方法详解

热门文章

  1. 良好的编程习惯(注释)
  2. Microsoft Jet 数据库引擎打不开文件 的正确解决方法
  3. 深度学习_GAN_Pix2Pix
  4. oracle数据源ODBC的配置
  5. 怎样利用github搭建个人博客
  6. 100种思维模型之递弱代偿原理思维模型-95
  7. 用Python爬虫+Crontab实现自动更换电脑壁纸
  8. AC3 Rematrix
  9. 集成 微信短视频 效果
  10. 北京理工大学电路与电子线路设计实践