Submission #85724

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
857242018-11-21 12:01:08leejseo매트 (KOI15_mat)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int N, W, rst;
class Line {
public:
int x, i;
bool r;
Line(int x, int i, bool r): this->x(x), this->i(i), this->r(r) {}
bool operator < (const Line &l) const {
return this->x < l.x;
}
};
class Mat {
public:
int P, L, R, H, K;
Mat(int P, int L, int R, int H, int K): this->P(P), this->L(L), this->R(R), this->H(H), this->K(K) {}
bool meet(const Mat &M) const {
if (this->R <= M.L || this->L >= M.R) return false;
if (this->P == M.P) return true;
return this->H + M.H > W;
}
bool operator < (const Mat &M) const {
return this->R != M.R ? this->R < M.R : this->L < M.L;
}
};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

mat.cpp: In constructor 'Line::Line(int, int, bool)':
mat.cpp:11:37: error: expected identifier before 'this'
         Line(int x, int i, bool r): this->x(x), this->i(i), this->r(r) {}
                                     ^~~~
mat.cpp:11:37: error: expected '{' before 'this'
mat.cpp: In constructor 'Mat::Mat(int, int, int, int, int)':
mat.cpp:20:49: error: expected identifier before 'this'
         Mat(int P, int L, int R, int H, int K): this->P(P), this->L(L), this->R(R), this->H(H), this->K(K) {}
                                                 ^~~~
mat.cpp:20:49: error: expected '{' before 'this'