| ||||||||||
| 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:lyg at 2006-10-15 11:21:07 int check(int t) { //check whether t is a possible time
int i, j, now = 0, num = 0;
i = t/20 + 2;
while(i <= n) {
while(i <= n && ind[i] == 0)
i++;
if((i-1)*4+10*num > t)
return 0;
j = (t-10*num+20*i+4)/24;
i = (t-10*num+16*j+4)/20+1;
num++;
}
return 1;
} //end check
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator