foo.cpp:15:22: error: storage size of 'x' isn't known
int n, f, a, b, k, x[], y[K], w[K], maxv[3000005], addv[3000005];
^
foo.cpp: In member function 'bool Line::operator<(const Line&) const':
foo.cpp:22:25: warning: statement has no effect [-Wunused-value]
if (x == l.x) d > l.d;
~~^~~~~
foo.cpp: In function 'void update(int, int, int, int, int, int)':
foo.cpp:33:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = l + r >> 1;
~~^~~
foo.cpp: In function 'int main()':
foo.cpp:59:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < events.size(); i++) {
~~^~~~~~~~~~~~~~~