| ||||||||||
| 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 | |||||||||
事关考试,hawk有空就帮忙看一下吧,实在想不明白In Reply To:VC编译过了,给G++居然CE,好嘛好嘛,明天就拿这个考我好了 Posted by:00448264 at 2005-06-16 13:40:39 定义这样一个结构去给std::sort排序,VC过了,G++就是CE
struct INTERVAL
{
int b, e;
INTERVAL(int _b = 0, int _e = 0) : b(_b), e(_e)
{
;
}
bool operator <(const INTERVAL &rhs)
{
int l1 = e - b;
int l2 = rhs.e - rhs.b;
if(l1 != l2)
{
return l1 < l2;
}
else
{
return memcmp(line + b, line + rhs.b, l1) < 0;
}
}
};
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator