| ||||||||||
| 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 | |||||||||
给Output Limit Exceed的朋友们在进行next_permutation排序的时候,使用的比较函数,请注意注释的地方。可以使用AAB这样的输入检验一下看是否会OLE
bool
cmp(const char &a, const char &b)
{
char la, lb;
la = tolower(a);
lb = tolower(b);
if (la < lb)
return true;
else if (la > lb)
return false;
else {
//如果按照注释这样写的话会Output Limit Exceed.
//if(isupper(a))return true;
if (isupper(a) && a != b)
return true;
else
return false;
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator