题目传送门

 1 /*
 2     水题:ans = (1+2+3+...+n) * k - n,开long long
 3 */
 4 #include <cstdio>
 5 #include <algorithm>
 6 #include <cstring>
 7 #include <cmath>
 8 using namespace std;
 9
10 typedef long long ll;
11
12 int main(void)        //Codeforces Round #304 (Div. 2) A. Soldier and Bananas
13 {
14     int k, n, w;
15     while (scanf ("%d%d%d", &k, &n, &w) == 3)
16     {
17         ll sum = (1 + w) * w / 2 * k;
18         if (sum < n)    puts ("0");
19         else    printf ("%I64d\n", sum - n);
20     }
21
22     return 0;
23 }
24
25
26 /*
27 3 17 4
28 */

转载于:https://www.cnblogs.com/Running-Time/p/4530581.html

水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas相关推荐

  1. codeforces水题100道 第五题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas (math)

    题目链接:http://www.codeforces.com/problemset/problem/546/A 题意:一个人现在有n元,它买第i根香蕉需要i*k元,问他要买w根香蕉的话,需要问他的朋友 ...

  2. Codeforces Round #304 (Div. 2) D. Soldier and Number Game 数学 质因数个数

    D. Soldier and Number Game Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/conte ...

  3. codeforces水题100道 第二十七题 Codeforces Round #172 (Div. 2) A. Word Capitalization (strings)...

    题目链接:http://www.codeforces.com/problemset/problem/281/A 题意:将一个英文字母的首字母变成大写,然后输出. C++代码: #include < ...

  4. codeforces水题100道 第十一题 Codeforces Round #143 (Div. 2) A. Team (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/231/A 题意:问n道题目当中有多少道题目是至少两个人会的. C++代码: #include &l ...

  5. codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)

    题目链接:http://www.codeforces.com/problemset/problem/268/A 题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可 ...

  6. 递推水题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table

    题目传送门 1 /* 2 模拟递推水题 3 */ 4 #include <cstdio> 5 #include <iostream> 6 #include <cmath& ...

  7. Codeforces Round #304 (Div. 2)

    这次打得较差,差点就绿了... B题,这B题竟然WA了,再看看就发现一个很严重的错误..--! #include <iostream> #include <cstdio> #i ...

  8. Codeforces Round #592 (Div. 2) G. Running in Pairs 构造(水)

    传送门 文章目录 题意: 思路: 题意: 思路: 史上最水GGG题,没有之一. 考虑最小的情况如何构造,显然就是让a,ba,ba,b都1−n1-n1−n依次排列即可,这样的最小值为n∗(n+1)2\f ...

  9. Codeforces Round #701 (Div. 2) A ~ F ,6题全,超高质量良心题解【每日亿题】2021/2/13

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A - Add and Divide B - Replace and Keep Sorted C ...

最新文章

  1. 源码阅读:AFNetworking(十六)——UIWebView+AFNetworking
  2. IIS6.0 web.config
  3. python实战系列之写个好玩的猜拳游戏(附源代码)
  4. python argparse模块详解_python学习之argparse模块
  5. linux 工具 SecureCRT 使用 rz 和 sz 命令
  6. 怎么更好练习数位板_如何设计更好的仪表板
  7. java put set_Java PutItemRequest.setItem方法代码示例
  8. Java函数式编程整理
  9. android c++ http,开源一个C++实现的简单HTTP协议处理库
  10. 这是我的第一个用例图
  11. 手把手教你获取一年免费通配符泛域名SSL证书
  12. base64加密及方式
  13. Spring Boot 整合 shiro 之盐值加密认证详解(六)
  14. 数据库数字孪生技术获突破,Ganos两项研究成果入选VLDB
  15. CocosCreator之Animation动画组件
  16. SVN+Gitee配置版本控制库
  17. 微服务项目框架及多模块开发
  18. 互联网公司薪酬、加班时长排名出炉 !
  19. word中插入smartart图形(插入图形、设置图形格式、在下方插入图形、在后方插入图形)
  20. python技术培训机构排名

热门文章

  1. win10系统崩溃怎么修复_新手怎么重装系统win10
  2. 如何打造领英朋友圈_领英点赞,请摆好姿势!
  3. 编程中怎样将列表中数字排序_R编程中的列表
  4. 在Ubuntu 18.04上安装MongoDB
  5. Python中的numpy.append()
  6. web界面设计工具_您应该了解的14个Web设计工具
  7. python当前日期时间_Python当前日期时间
  8. 在Ubuntu 18.04上安装Jenkins
  9. 什么是物联网?在生活中有何体现?
  10. Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: