mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:3:14: error: 'set' is not a member of 'std'
3 | std::set<int> v;
| ^~~
mushrooms.cpp:2:1: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
1 | #include "mushrooms.h"
+++ |+#include <set>
2 | int count_mushrooms(int n) {
mushrooms.cpp:3:18: error: expected primary-expression before 'int'
3 | std::set<int> v;
| ^~~
mushrooms.cpp:4:19: error: 'sqrt' was not declared in this scope
4 | int q = 2*sqrt(n);
| ^~~~
mushrooms.cpp:5:14: error: 'set' is not a member of 'std'
5 | std::set<int> a;
| ^~~
mushrooms.cpp:5:14: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
mushrooms.cpp:5:18: error: expected primary-expression before 'int'
5 | std::set<int> a;
| ^~~
mushrooms.cpp:6:9: error: 'a' was not declared in this scope
6 | a.insert(0);
| ^
mushrooms.cpp:24:17: error: 'v' was not declared in this scope
24 | v.insert(1);
| ^
mushrooms.cpp:38:33: error: 'v' was not declared in this scope
38 | v.insert(i+1);
| ^
mushrooms.cpp:42:33: error: 'v' was not declared in this scope
42 | v.insert(i);
| ^
mushrooms.cpp:56:18: error: 'v' was not declared in this scope; did you mean 'vv'?
56 | int vv = v.size(), aa = a.size();
| ^
| vv
mushrooms.cpp:57:14: error: redeclaration of 'bool flag'
57 | bool flag = (vv<=aa);
| ^~~~
mushrooms.cpp:16:14: note: 'bool flag' previously declared here
16 | bool flag;
| ^~~~
mushrooms.cpp:57:26: error: 'aa' was not declared in this scope
57 | bool flag = (vv<=aa);
| ^~
mushrooms.cpp:58:19: error: 'max' was not declared in this scope; did you mean 'std::max'?
58 | int fac = max(vv, aa);
| ^~~
| std::max
In file included from /usr/include/c++/13/vector:62,
from mushrooms.h:1,
from mushrooms.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
mushrooms.cpp:60:17: error: 'vector' was not declared in this scope
60 | vector<int> mm;
| ^~~~~~
mushrooms.cpp:60:17: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66:
/usr/include/c++/13/bits/stl_vector.h:428:11: note: 'std::vector'
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
/usr/include/c++/13/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
mushrooms.cpp:60:24: error: expected primary-expression before 'int'
60 | vector<int> mm;
| ^~~
mushrooms.cpp:64:33: error: 'mm' was not declared in this scope
64 | mm.push_back(it);
| ^~
mushrooms.cpp:68:46: error: 'mm' was not declared in this scope
68 | int vi = use_machine(mm);
| ^~
mushrooms.cpp:74:33: error: 'mm' was not declared in this scope
74 | mm.push_back(it);
| ^~
mushrooms.cpp:78:46: error: 'mm' was not declared in this scope
78 | int vi = use_machine(mm);
| ^~