今天在CSP2021的真题考试的时候,本蒟蒻写了如下程序:
struct node{
int v,no;
operator <(const node a)const{
return this->v > a.v;
}
};
于是喜提 0pts ——本地编译可以过,而且功能也是正确的。但是在cena收上去用lemon测的时候爆零了。124pts→24pts,如果是去年CSP-S考试的话就要被淘汰力...
于是本蒟蒻找到了你,询问这到底是哪里出锅了?是C++版本不同(评测机应该是C++14的标准)的问题吗?另外,请问考试的时候可以用如下程序(网上搜的,可以在编译机上编译且功能正确)吗?
struct node{
int v,no;
bool operator <(const node& a)const{
return this->v > a.v;
}
};
如果这个程序才是正确的话,除去加上了bool以外,这个地址符node&有什么用呢?