Problem deforestation
User TheRaptor
Submission Time 2023-11-21 20:49:33
Score 0
Max Time N/A
Max Memory N/A

Compile Error

deforestation.cpp: In function ‘void ins(node*&, std::pair<long long int, long long int>)’:
deforestation.cpp:34:24: error: no matching function for call to ‘merge(node*&, node*)’
34 | merge(nd,new node(val));
| ^
deforestation.cpp:22:6: note: candidate: ‘void merge(node*&, node*&)’ <near match>
22 | void merge(node* &ll, node* &rr){
| ^~~~~
deforestation.cpp:22:6: note: conversion of argument 2 would be ill-formed:
deforestation.cpp:34:11: error: cannot bind non-const lvalue reference of type ‘node*&’ to an rvalue of type ‘node*’
34 | merge(nd,new node(val));
| ^~~~~~~~~~~~~
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from deforestation.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:4955:5: note: candidate: ‘template<class _IIter1, class _IIter2, class _OIter>