Gold Coins
http://poj.org/problem?id=2000
#include<stdio.h>
const int N=;
int main()
{
int coin[N];
long long n,i = ,j,k;
j = ;
k = ;
while (i < )
{
if (k < j)
{
coin[i++] = j;
k++;
}
if (k >= j)
{
k = ;
j++;
} }
while(~scanf("%lld",&n)&&n)
{
long long scoin = ;
for (i = ; i <= n; i ++)
scoin += coin[i];
printf("%lld %lld\n",n,scoin);
}
return ;
}
Gold Coins的更多相关文章
- 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: ...
- hdoj 2401 Baskets of Gold Coins
Baskets of Gold Coins Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Ot ...
- 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 ...
- 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天的金币数. ...
- Baskets of Gold Coins_暴力
Problem Description You are given N baskets of gold coins. The baskets are numbered from 1 to N. In ...
随机推荐
- pipreqs(找当前项目依赖的包)
pipreqs pipreqs可以帮你找到当前项目的所有组件及其版本.就是当别人给你一个程序的时候,你要在自己电脑上运行起来,就需要安装程序所依赖的组件,总不能自己一个一个找吧. # 安装 pip3 ...
- buf.readUInt8()
buf.readUInt8(offset[, noAssert]) offset {Number} 0 <= offset <= buf.length - 1 noAssert {Bool ...
- 被 idea 坑了的记录篇
这个星期真的是波折的一周~~~~ 不得不吐槽下无敌坑的自己了,社会我娜姐,坑起来连自己都坑~~ 其实这也不全算我自己的坑,我只是卸载了idea,重新装了一下而已,很神奇的把idea的几个坑全撞了一遍( ...
- lua 栈最后调用的函数,用于看调试信息
lua_getinfo int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); 返回一个指定的函数或函数调用的信息. 当用于取 ...
- poj 1379 模拟退火法
/* 模拟退火法: 找到一些随机点,从这些点出发,随机的方向坐标向外搜索: 最后找到这些随机点的最大值: 坑://if(xx>-eps&&xx<x+eps&& ...
- hdu 2546 0-1背包
#include<stdio.h> #include<string.h> #define N 1100 int dp[N],a[N]; int main() { int n,m ...
- spring历史地址
http://repo.spring.io/release/org/springframework/spring/
- sql-server-storage-internals
https://www.simple-talk.com/sql/database-administration/sql-server-storage-internals-101/
- kfk: async disk IO深度解析
http://www.itpub.net/thread-1724044-1-1.html
- Clojure: 寻找项目依赖项目
Clojure寻找项目依赖项目: lein deps :tree