I've faced the stack overflow problem. As far as I got, the problem is in the size of a string array.
If I put 10^4 size it works fine, but if the size is increased to 10^5, it throws an error.
using namespace std;
string getRow(int dig) {
string row = "";
if (dig) {
row += getRow((dig - 1) / 26);
char c = 'A' + (dig - 1) % 26;
row += c;
}
return row;
}
int main()
{
int n,m;
string inp[100000], col, row, last;
smatch sm;
auto pattern = regex("(R)(\\d+)(C)(\\d+)");
auto pattern2 = regex("([A-Z]+)(\\d+)");
cin >> n;
for(int i=0; i < n; i++)
cin >> inp[i];
for(int i=0; i < n; i++) {
if(regex_match(inp[i], sm, pattern)) {
}else if(regex_match(inp[i], sm, pattern2)) {
}
}
return 0;
}