| ||||||||||
| 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 | |||||||||
ISO的标准到底有什么新规定啊In Reply To:事关考试,hawk有空就帮忙看一下吧,实在想不明白 Posted by:frkstyc at 2005-06-16 13:43:21 > 定义这样一个结构去给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