Problem gerrymandering
User justin271828
Submission Time 2024-12-12 19:41:04
Score 0
Max Time N/A
Max Memory N/A

Compile Error

gerrymandering.cpp: In function ‘int main()’:
gerrymandering.cpp:44:55: error: no match for ‘operator=’ (operand types are ‘node’ and ‘node*’)
44 | for (int j = 0; j <= K; j++) mem[j] = new node(0, N+5);
| ^
gerrymandering.cpp:4:8: note: candidate: ‘constexpr node& node::operator=(const node&)’
4 | struct node{
| ^~~~
gerrymandering.cpp:4:8: note: no known conversion for argument 1 from ‘node*’ to ‘const node&’
gerrymandering.cpp:4:8: note: candidate: ‘constexpr node& node::operator=(node&&)’
gerrymandering.cpp:4:8: note: no known conversion for argument 1 from ‘node*’ to ‘node&&’
gerrymandering.cpp:47:26: error: base operand of ‘->’ has non-pointer type ‘node’
47 | int val = max(mem[j-1]->q(0, k-1)+1, mem[j-1]->q(k+1, N+5));}}
| ^~
gerrymandering.cpp:47:49: error: base operand of ‘->’ has non-pointer type ‘node’