hdoj 2401 Baskets of Gold Coins
Baskets of Gold Coins
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1855 Accepted Submission(s): 1104
N will be at least 2 and not more than 8000. The value of w will be at most 30. The value of d will be less than w.
#include<stdio.h>
#include<string.h>
#define LL long long
int main()
{
int w,d,n;
int i;
LL m,sum,ans;
while(scanf("%d%d%d%lld",&n,&w,&d,&m)!=EOF)
{
sum=0;
for(i=1;i<n;i++)
sum+=i*w;
ans=sum-m;
if(ans==0)
printf("%d\n",n);
else
printf("%lld\n",ans/d);
}
return 0;
}
hdoj 2401 Baskets of Gold Coins的更多相关文章
- HDOJ(HDU) 2401 Baskets of Gold Coins(数列、)
Problem Description You are given N baskets of gold coins. The baskets are numbered from 1 to N. In ...
- Baskets of Gold Coins
Baskets of Gold Coins Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Ot ...
- Baskets of Gold Coins_暴力
Problem Description You are given N baskets of gold coins. The baskets are numbered from 1 to N. In ...
- Gold Coins 分类: POJ 2015-06-10 15:04 16人阅读 评论(0) 收藏
Gold Coins Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21767 Accepted: 13641 Desc ...
- OpenJudge/Poj 2000 Gold Coins
1.链接地址: http://bailian.openjudge.cn/practice/2000 http://poj.org/problem?id=2000 2.题目: 总Time Limit: ...
- H - Gold Coins(2.4.1)
H - Gold Coins(2.4.1) Crawling in process... Crawling failed Time Limit:1000MS Memory Limit:3000 ...
- poj 2000 Gold Coins(水题)
一.Description The king pays his loyal knight in gold coins. On the first day of his service, the kni ...
- poj 2000 Gold Coins
题目链接:http://poj.org/problem?id=2000 题目大意:求N天得到多少个金币,第一天得到1个,第二.三天得到2个,第四.五.六天得到3个....以此类推,得到第N天的金币数. ...
- Gold Coins
http://poj.org/problem?id=2000 #include<stdio.h> ; int main() { int coin[N]; ,j,k; j = ; k = ; ...
随机推荐
- 玩转HTML5移动页面(优化篇)
原文:http://www.grycheng.com/?p=472 承接上文<玩转HTML5移动页面(动效篇)>,上次说的是让页面动起来的一些小技巧.而页面动起来的根基是功能可用的页面,因 ...
- (转载)MVC + JQUERY + AJAX的几种方式
MVC + JQUERY + AJAX的几种方式 // 传过去一个简单值,获取一个简单值 $.ajax({ type: "GET", url: ...
- bootstrap-datepicker 日期拾取器
最近开发的项目界面用的是bootstrap的框架,发现开源的东西真的很多,慢慢的我会记录到上面来 地址 http://www.bootcss.com/p/bootstrap-datetimepick ...
- ListToDataTable
public static DataTable ToDataTable<T>(IEnumerable<T> collection) { var ...
- 详解C/C++函数指针声明
要理解一个C程序,仅仅理解组成该程序的符号是不够的.程序员还必须理解这些符号是如何组合成声明.表达式.语句和程序的. 我们先来看看下面的一个语句: 1 ( *( void(*)())0)(); 这是当 ...
- VIM一些常用命令,方法,配置
配置文件地址 github 工具只是为了更好的工具,选择一种,坚持使用学习记忆,熬过瓶颈期就可以了. 现在我基本大的项目是IDE+vim 插件,写小代码是VIM. 常用的操作,便捷的方法 1.如何选中 ...
- 【技术帖】解决 Hudson jenkins 连接等待中 - Waiting for next av
今天构建项目发现如下问题: jenkins 连接等待中 - Waiting for next available executor 左下角那块一直不运行构建,一直在连接等待. 于是,进入一级页面, 右 ...
- front-end
http://info.1688.com/detail/1139720782.html http://segmentfault.com/q/1010000000136513 http://h5apps ...
- POJ 1778 All Discs Considered(拓扑排序)
点我看题目 题意 :其实题意我也说不清楚,因为比赛的时候我盯着看了1个小时也没看懂....就是两个磁盘,第一个有n1的安装包,编号为1~n1,第二个有n2个安装包,编号为n1~n2.给你d对关系,(x ...
- php 文件下载 以及 file_exists找不到文件的解决方案
链接:<a href="upload/file/download.php?filename=雨人工作室.doc" target="_blank" > ...