水题 Codeforces Round #304 (Div. 2) A. Soldier and Bananas
题目传送门
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相关推荐
- 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根香蕉的话,需要问他的朋友 ...
- 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 ...
- codeforces水题100道 第二十七题 Codeforces Round #172 (Div. 2) A. Word Capitalization (strings)...
题目链接:http://www.codeforces.com/problemset/problem/281/A 题意:将一个英文字母的首字母变成大写,然后输出. C++代码: #include < ...
- codeforces水题100道 第十一题 Codeforces Round #143 (Div. 2) A. Team (brute force)
题目链接:http://www.codeforces.com/problemset/problem/231/A 题意:问n道题目当中有多少道题目是至少两个人会的. C++代码: #include &l ...
- codeforces水题100道 第十六题 Codeforces Round #164 (Div. 2) A. Games (brute force)
题目链接:http://www.codeforces.com/problemset/problem/268/A 题意:足球比赛中如果主场球队的主场球衣和客队的客队球衣颜色一样,那么要求主队穿上他们的可 ...
- 递推水题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table
题目传送门 1 /* 2 模拟递推水题 3 */ 4 #include <cstdio> 5 #include <iostream> 6 #include <cmath& ...
- Codeforces Round #304 (Div. 2)
这次打得较差,差点就绿了... B题,这B题竟然WA了,再看看就发现一个很严重的错误..--! #include <iostream> #include <cstdio> #i ...
- Codeforces Round #592 (Div. 2) G. Running in Pairs 构造(水)
传送门 文章目录 题意: 思路: 题意: 思路: 史上最水GGG题,没有之一. 考虑最小的情况如何构造,显然就是让a,ba,ba,b都1−n1-n1−n依次排列即可,这样的最小值为n∗(n+1)2\f ...
- Codeforces Round #701 (Div. 2) A ~ F ,6题全,超高质量良心题解【每日亿题】2021/2/13
整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A - Add and Divide B - Replace and Keep Sorted C ...
最新文章
- 源码阅读:AFNetworking(十六)——UIWebView+AFNetworking
- IIS6.0 web.config
- python实战系列之写个好玩的猜拳游戏(附源代码)
- python argparse模块详解_python学习之argparse模块
- linux 工具 SecureCRT 使用 rz 和 sz 命令
- 怎么更好练习数位板_如何设计更好的仪表板
- java put set_Java PutItemRequest.setItem方法代码示例
- Java函数式编程整理
- android c++ http,开源一个C++实现的简单HTTP协议处理库
- 这是我的第一个用例图
- 手把手教你获取一年免费通配符泛域名SSL证书
- base64加密及方式
- Spring Boot 整合 shiro 之盐值加密认证详解(六)
- 数据库数字孪生技术获突破,Ganos两项研究成果入选VLDB
- CocosCreator之Animation动画组件
- SVN+Gitee配置版本控制库
- 微服务项目框架及多模块开发
- 互联网公司薪酬、加班时长排名出炉 !
- word中插入smartart图形(插入图形、设置图形格式、在下方插入图形、在后方插入图形)
- python技术培训机构排名
热门文章
- win10系统崩溃怎么修复_新手怎么重装系统win10
- 如何打造领英朋友圈_领英点赞,请摆好姿势!
- 编程中怎样将列表中数字排序_R编程中的列表
- 在Ubuntu 18.04上安装MongoDB
- Python中的numpy.append()
- web界面设计工具_您应该了解的14个Web设计工具
- python当前日期时间_Python当前日期时间
- 在Ubuntu 18.04上安装Jenkins
- 什么是物联网?在生活中有何体现?
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: