QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#625956#7003. Rikka with Minimum Spanning Treesucup-team5071#Compile Error//C++20800b2024-10-09 22:02:472024-10-09 22:02:53

Judging History

你现在查看的是最新测评结果

  • [2024-10-09 22:02:53]
  • 评测
  • [2024-10-09 22:02:47]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll eps =0;
using pt=ll;
template<typename T> struct point
{
    T x,y;
    bool operator==(const point &a) const {return (abs(x-a.x)<=eps && abs(y-a.y)<=eps);}
    bool operator<(const point &a) const {if(abs(x-a.x)<=eps)return y<a.y-eps;return x<a.x-eps;}
    bool operator>(const point &a) const {return !(*this<a||*this==a);}
    point operater+(const point &a)const {return {x+a.x,y+a.y};}
    point operater-(const point &a)const {return {x-a.x,y-a.y};}
    point operater-()const {return {-x,-y};}
    T operator*(const point &a)const{return x*a.x+y*a.y;}
    T operator^(const point &a)const{return x*a.y-y*a.x;}
    int toleft(const point &a)const{const auto t=(*this)^a;return (t>eps)-(t<-eps);}
};

Details

answer.code:12:11: error: field ‘operater’ has incomplete type ‘point<T>’
   12 |     point operater+(const point &a)const {return {x+a.x,y+a.y};}
      |           ^~~~~~~~
answer.code:6:29: note: definition of ‘struct point<T>’ is not complete until the closing brace
    6 | template<typename T> struct point
      |                             ^~~~~
answer.code:12:11: error: expected ‘;’ at end of member declaration
   12 |     point operater+(const point &a)const {return {x+a.x,y+a.y};}
      |           ^~~~~~~~
      |                   ;
answer.code:12:19: error: expected unqualified-id before ‘+’ token
   12 |     point operater+(const point &a)const {return {x+a.x,y+a.y};}
      |                   ^
answer.code:13:11: error: field ‘operater’ has incomplete type ‘point<T>’
   13 |     point operater-(const point &a)const {return {x-a.x,y-a.y};}
      |           ^~~~~~~~
answer.code:6:29: note: definition of ‘struct point<T>’ is not complete until the closing brace
    6 | template<typename T> struct point
      |                             ^~~~~
answer.code:13:11: error: expected ‘;’ at end of member declaration
   13 |     point operater-(const point &a)const {return {x-a.x,y-a.y};}
      |           ^~~~~~~~
      |                   ;
answer.code:13:19: error: expected unqualified-id before ‘-’ token
   13 |     point operater-(const point &a)const {return {x-a.x,y-a.y};}
      |                   ^
answer.code:14:11: error: field ‘operater’ has incomplete type ‘point<T>’
   14 |     point operater-()const {return {-x,-y};}
      |           ^~~~~~~~
answer.code:6:29: note: definition of ‘struct point<T>’ is not complete until the closing brace
    6 | template<typename T> struct point
      |                             ^~~~~
answer.code:14:11: error: expected ‘;’ at end of member declaration
   14 |     point operater-()const {return {-x,-y};}
      |           ^~~~~~~~
      |                   ;
answer.code:14:19: error: expected unqualified-id before ‘-’ token
   14 |     point operater-()const {return {-x,-y};}
      |                   ^