hdu acm 第1592题哪里错了?代码如下,错误是 runtime errorProblem DescriptionGardon bought many many chocolates from the A Chocolate Market (ACM).When he was on the way to meet Angel,he met Speakless by accident."Ah,so many delicious chocola

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/27 01:27:47

hdu acm 第1592题哪里错了?代码如下,错误是 runtime error
Problem Description
Gardon bought many many chocolates from the A Chocolate Market (ACM).When he was on the way to meet Angel,he met Speakless by accident.
"Ah,so many delicious chocolates!I'll get half of them and a half!" Speakless said.
Gardon went on his way,but soon he met YZG1984 by accident.
"Ah,so many delicious chocolates!I'll get half of them and a half!" YZG1984 said.
Gardon went on his way,but soon he met Doramon by accident.
"Ah,so many delicious chocolates!I'll get half of them and a half!" Doramon said.
Gardon went on his way,but soon he met JGShining by accident.
"Ah,so many delicious chocolates!I'll get half of them and a half!" JGShining said.
.
.
.
After had had met N people ,Gardon finally met Angel.He gave her half of the rest and a half,then Gardon have none for himself.Could you tell how many chocolates did he bought from ACM?
Input
Input contains many test cases.
Each case have a integer N,represents the number of people Gardon met except Angel.N will never exceed 1000;
Output
For every N inputed,tell how many chocolates Gardon had at first.
Sample Input
2
Sample Output
7
题目分析可知是2的(n+1)次方减去1;
#include
int f[1001][1001];
void add(int k)
{
int i;
for(i=0;i

额,如果已经知道答案是2的(n+1)次方减一了的话,你为什么不直接include然后调用pow(2.0,n+1)函数,得出结果再减一不就行了?

hdu acm 第1592题哪里错了?代码如下,错误是 runtime errorProblem DescriptionGardon bought many many chocolates from the A Chocolate Market (ACM).When he was on the way to meet Angel,he met Speakless by accident.Ah,so many delicious chocola 哪里错了?线代.线代. 线代:哪里错了? hdu 求数论知识 怎么算(a/b)%c 比如说:对于一个给定的正整数n求另一个正整数 满足m>=((6^n-1)/30)%2011其实是一道acm题 公式推出来是这样 不知道怎么破了http://acm.hdu.edu.cn/showproblem.php?pid=4599 线代,哪里错了呢? 一道ACM题,为什么WA了,Nowadays,a kind of chess game called “Super Jumping!Jumping!Jumping!” is very popular in HDU.Maybe you are a good boy,and know little about this game,so I introduce it to you now.The game can be played by two or more t 杭电2010哪里错了.#include int c=0;int main (){int a,b,d,e,f;while (scanf(%d%d,&a,&b)==2){if(a999||b999) break;for(;a杭电HDU水仙花 第9.10题哪里错了… 第5题哪里错了 第7题哪里错了 ACM竞赛中谈到AC了题, 杭电1163 怎么做?什么思路?http://acm.hdu.edu.cn/showproblem.php?pid=1163 acm 1008 杭电 什么意思请帮我解释一下,谢谢!题目地址 http://acm.hdu.edu.cn/showproblem.php?pid=1008 hdu acm 难度分布问题杭州科技大学acm题目的难度分布是怎么样的越往后越难吗 还是?改正:是杭州电子科技大学 杭电acm第3809题的详细思路 杭电ACM第2136题Largest prime factor, HDU 1032 是说的什么意思?看不懂了!