| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:那个程序有一个不太明显的错误In Reply To:那个程序有一个不太明显的错误 Posted by:number at 2006-03-23 00:14:30 left_time = h*60-t[k]*5;//////
for(i=1;i<=n;i++)
{
ff[i] = f[i];
tt[i] = 0;
}
while(left_time > 0)
{
j = 1;
for(i=1;i<=k;i++)
{
if(ff[i] > ff[j])
j = i;
}
if(ff[j] == 0)////鱼都没了;
break;
tt[j] += 5;
fish += ff[j];
ff[j] -= d[j];
if(ff[j] <=0)
ff[j] = 0;
left_time -= 5;
}
//left_time>=0;
tt[1] += left_time;
____________________________________________________________________
left_time = h*60-t[k]*5;
这条语句有可能把left_time整成负数。
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator