通过率一直70%,换了c++也是,说是超时,看着很简单啊,怎么就超时了呢,无比郁闷,x,f,d,p是输入的四个变量 liveday = 0; while(f > 0 && d >= x){ f -= 1; d -= x; liveday++; /*if(f == 0 && d > p){ f = 1; d -= p; }*/ } if(d>0){ liveday += Math.floor(d/(x+p)); } console.log(liveday);
点赞 2

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务