杭电acm2103求助,下面是我的代码,我试过了许多数据都通过了,可是总被WA,
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/31 04:33:16
杭电acm2103求助,下面是我的代码,我试过了许多数据都通过了,可是总被WA,
As far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn as much babies as he could.Unfortunatly,the president XiaoHu already found LJ's extreme mind,so he have to publish a policy to control the population from keep on growing.According the fact that there are much more men than women,and some parents are rich and well educated,so the president XiaoHu made a family planning policy:
According to every parents conditions to establish a number M which means that parents can born M children at most.But once borned a boy them can't born other babies any more.If anyone break the policy will punished for 10000RMB for the first time ,and twice for the next time.For example,if LJ only allowed to born 3 babies at most,but his first baby is a boy ,but he keep on borning another 3 babies,so he will be punished for 70000RMB(10000+20000+40000) totaly.
Input
The first line of the input contains an integer T(1
As far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn as much babies as he could.Unfortunatly,the president XiaoHu already found LJ's extreme mind,so he have to publish a policy to control the population from keep on growing.According the fact that there are much more men than women,and some parents are rich and well educated,so the president XiaoHu made a family planning policy:
According to every parents conditions to establish a number M which means that parents can born M children at most.But once borned a boy them can't born other babies any more.If anyone break the policy will punished for 10000RMB for the first time ,and twice for the next time.For example,if LJ only allowed to born 3 babies at most,but his first baby is a boy ,but he keep on borning another 3 babies,so he will be punished for 70000RMB(10000+20000+40000) totaly.
Input
The first line of the input contains an integer T(1
![杭电acm2103求助,下面是我的代码,我试过了许多数据都通过了,可是总被WA,](/uploads/image/z/18735729-33-9.jpg?t=%E6%9D%AD%E7%94%B5acm2103%E6%B1%82%E5%8A%A9%2C%E4%B8%8B%E9%9D%A2%E6%98%AF%E6%88%91%E7%9A%84%E4%BB%A3%E7%A0%81%2C%E6%88%91%E8%AF%95%E8%BF%87%E4%BA%86%E8%AE%B8%E5%A4%9A%E6%95%B0%E6%8D%AE%E9%83%BD%E9%80%9A%E8%BF%87%E4%BA%86%2C%E5%8F%AF%E6%98%AF%E6%80%BB%E8%A2%ABWA%2C)
这题目有意思,计划生育,还president XiaoHu,亏他想得出来.
同意一楼的看法,你还缺了一种情况没考虑:M = 0(这不是不给生孩子嘛!出题者也够绝的.)
找出问题就好解决的,修改两处即可.(当然,还有其他方法,你的代码你最清楚)
#include
using namespace std;
int main()
{
int M,N,baby[31],i,T;
__int64 p,s;
scanf("%d",&T);
while(T--&&scanf("%d%d",&M,&N)!=EOF)
{
for(i=1;i
同意一楼的看法,你还缺了一种情况没考虑:M = 0(这不是不给生孩子嘛!出题者也够绝的.)
找出问题就好解决的,修改两处即可.(当然,还有其他方法,你的代码你最清楚)
#include
using namespace std;
int main()
{
int M,N,baby[31],i,T;
__int64 p,s;
scanf("%d",&T);
while(T--&&scanf("%d%d",&M,&N)!=EOF)
{
for(i=1;i
马上考初中了,可是,我许多的拼音都忘记了.例如:平舌音.翘舌音.
沁园春 雪是怎么写的我以前学过.可是现在都想不起来了.
我们要有一次数学竞赛,老师让我们出一些做过的、会的奥数题,可是我从来都不做的= =.只好来求助了,
有谁会用stata进行logistic回归分析的,数据这些我都弄好了,下面是结果,看不懂,
我感觉每次做托福阅读题的时候文章差不多都读懂了,可是就是总做错题,不知道是哪里出了问题?
电热丝通电但是不发热我用电笔试过了 电热丝上是显示有电的 可是为什么不发热啊 也不红
下面这段代码,谁能帮我解释一下,谢谢了!
世界上唯一不变的是?一个人的题问这个问题也许是感情方面的问题,下面那下答案我都试过了,可惜都不正确,
谁能帮我解释一下下面代码的意思,我看不懂,所以有错都调试不来,在每一行后面//注释一下,麻烦了
一道杭电ACM的测试题,我运行的没问题,但是提交却是WA,
杭电acm 1005 我觉得很简单,不知道怎么出现stack_overflow,求大神指教.下面是代码.
英语专四的问题啊现在做了很多真题,和许多模拟题,都在65左右上下晃,好的时候能到75,可是这个波动比较大,我就想过,拿个