Language: C++

#include<bits/stdc++.h>
using namespace std;

#define     __FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define dbg cout << "dbg\n"
#define nll cout << "\n"
#define ll long long
#define MAX 100002
#define log_size 18
#define MOD 1000000007
#define INF 10000000000
#define ii pair<ll,ll>
#define presion cout << fixed << setprecision(6)

vector<int>adj[MAX];
vector<int>radj[MAX];
bool visit[MAX];
vector<int> order, component;

void dfs1(int u){
	visit[u] = true;
	for(int& v : adj[u]){
		if(!visit[v]){
			dfs1(v);
		}
	}
	order.push_back(u);
	return;
}

void dfs(int u){
	visit[u] = true;
	component.push_back(u);
	for(int& v : radj[u]){
		if(!visit[v]){
			dfs(v);
		}
	}
	return;
}

int main(){
	string s;
	cin >> s;
	int ans = 1;
	if(s == "RRR"){
		ans = 3;
	}
	if(s == "RRS"){
		ans = 2;
	}
	if(s == "SRR"){
		ans = 2;
	}
	if(s == "SSS"){
		ans = 0;
	}
	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'void dfs1(int)':
a.cc:21:9: error: reference to 'visit' is ambiguous
   21 |         visit[u] = true;
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:6: note:                 'bool visit [100002]'
   17 | bool visit[MAX];
      |      ^~~~~
a.cc:23:21: error: reference to 'visit' is ambiguous
   23 |                 if(!visit[v]){
      |                     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:6: note:                 'bool visit [100002]'
   17 | bool visit[MAX];
      |      ^~~~~
a.cc: In function 'void dfs(int)':
a.cc:32:9: error: reference to 'visit' is ambiguous
   32 |         visit[u] = true;
      |         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:6: note:                 'bool visit [100002]'
   17 | bool visit[MAX];
      |      ^~~~~
a.cc:35:21: error: reference to 'visit' is ambiguous
   35 |                 if(!visit[v]){
      |                     ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:6: note:                 'bool visit [100002]'
   17 | bool visit[MAX];
      |      ^~~~~