criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
using namespace std;

#define MAX 1000000
bool isPrime[MAX+1];

int main( void )
{
    int a, d, n;
    memset( isPrime, false, sizeof( isPrime ) );

    isPrime[2] = true;
    for ( int i = 3; i <= MAX; i += 2 ) isPrime[i] = true;
    for ( int i = 3; i <= MAX; i += 2 )
    {
        if ( isPrime[i] == false ) continue;
        for ( int j = i + i; j <= MAX; j += i ) isPrime[j] = false;
    }

    while ( cin >> a >> d >> n && a && d && n )
    {
        int answer  = -1;
        int count   = 0;
        int term    = a;
        while ( count < n )
        {
            if ( isPrime[term] )
            {
                answer = term;
                count ++;
            }
            term += d;
        }

        cout << answer << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset( isPrime, false, sizeof( isPrime ) );
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

// 2006à\IA fBNÌZpè

#include <iostream>

using namespace std;

int main(){
	bool isPrime[1000000]; 
	memset(isPrime, true, sizeof(isPrime));
	isPrime[1] = false;
	for(int i=2;i<1000000;i++){
		if(!isPrime[i]) continue;
		for(int j=2;i*j<1000000;j++) isPrime[i*j] = false;
	}
	int a, d, n;
	while(cin >> a >> d >> n){
		if(!a) break;
		int count = 1;
		for(int i=a;;i+=d){
			if(isPrime[i]){
				if(count == n) { cout << i << endl; break; }
				else count++;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'memset' was not declared in this scope
    9 |         memset(isPrime, true, sizeof(isPrime));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <iostream>
  +++ |+#include <cstring>
    4 |
Language: C++

//suhan lee, saitama university;
#include <iostream>
#include <math.h >

int main(){
  using namespace std;
  int a,d,n,i,tmp;
  int table[9307+346*210]; 
  while(1){
    cin>>a>>d>>n; 
    tmp=a;i=0;
    if(a==0&&d==0&&n==0)   return 0;
    while(1){   
      for(int j=2;j<=(int)sqrt(tmp) ;j++)
	{
	
	  if(tmp%j==0){
	    
	    j=1;
	    tmp+=d;
	    continue;
	  }
	}
      i++;
      if(i==n){
	cout<<tmp<<endl; 
	break;

      }
      tmp+=d;
    }
  
  }
}

Compiler output:
a.cc:3:10: fatal error: math.h : No such file or directory
    3 | #include <math.h >
      |          ^~~~~~~~~
compilation terminated.
Language: C++

//suhan lee, saitama university;
#include <iostream>
#include <Cmath>

int main(){
  using namespace std;
  int a,d,n,i,tmp;
  int table[9307+346*210]; 
  while(1){
    cin>>a>>d>>n; 
    tmp=a;i=0;
    if(a==0&&d==0&&n==0)   return 0;
    while(1){   
      for(int j=2;j<=(int)sqrt(tmp) ;j++)
	{
	
	  if(tmp%j==0){
	    
	    j=1;
	    tmp+=d;
	    continue;
	  }
	}
      i++;
      if(i==n){
	cout<<tmp<<endl; 
	break;

      }
      tmp+=d;
    }
  
  }
}

Compiler output:
a.cc:3:10: fatal error: Cmath: No such file or directory
    3 | #include <Cmath>
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cmath>
#define N 1000000
using namespace std;

int main()
{
	int a, d, n, i;
	bool prime[N];
	
	memset(prime, true, sizeof(prime));
	prime[0] = prime[1] = false;
	for (i = 2; i < sqrt(N) + 1; i++) {
		if (prime[i]) {
			for (int j = 2 * i; j < N; j += i) {
				prime[j] = false;
			}
		}
	}
	
	while (cin >> a >> d >> n, a) {
		for (i = a; n; i += d) {
			if (prime[i]) n--;
		}
		cout << i - d << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'memset' was not declared in this scope
   11 |         memset(prime, true, sizeof(prime));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cmath>
  +++ |+#include <cstring>
    3 | #define N 1000000
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int Sosuu_hantei(int N) {
	if (N==1) {return false};
	int M = sqrt(N) +1;
	for(int i=2; i<M; i ++ ){
		if(( N % i ) == 0 ) {return false;}
	}
	return true;
};

int main() {
	int a=0, d=0, n=0, Num=0;
	while(1){
		scanf("%d%d%d", &a, &d, &n);
		if (a == 0 && d == 0 && n == 0) break;
		Num = a;
		if (Sosuu_hantei(Num)) {n--;}
		while (n!=0) {
			Num +=d;
			if (Sosuu_hantei(Num)) {n--;}
		}
		printf("%d\n", Num);
	}
}

Compiler output:
a.cc: In function 'int Sosuu_hantei(int)':
a.cc:8:32: error: expected ';' before '}' token
    8 |         if (N==1) {return false};
      |                                ^
      |                                ;
Language: Java

import java.util.*;

public class Mrain{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int data = sc.nextInt();

		for(int i=0; i<data; i++){
			String str = sc.next();
			HashSet<String> hs = new HashSet<String>();

			hs.add(str);
			for(int j=1;j<str.length();j++){
				String before = str.substring(0, j);
				String after = str.substring(j, str.length());
				hs.add(after + before);
				before = new StringBuilder(before).reverse().toString();
				hs.add(before + after);
				hs.add(after + before);
				after = new StringBuilder(after).reverse().toString();
				hs.add(before + after);
				before = new StringBuilder(before).reverse().toString();
				hs.add(before + after);
				hs.add(after + before);
			}
			str = new StringBuilder(str).reverse().toString();
			hs.add(str);

			System.out.println(hs.size());
		}
	}
}

Compiler output:
Main.java:3: error: class Mrain is public, should be declared in a file named Mrain.java
public class Mrain{
       ^
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;


public class Main {
	
	static String change(String str){
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		return str;
	}
	
	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int m = sc.nextInt();
			for(int i=0;i<m;i++) {
				String tomas = sc.nextLine();
				ArrayList<String> pettern = new ArrayList<>();
				
				String s = "";
				
				for(int j=0;j<tomas.length()-1;j++) {
					for(int k=0;k<8;k++) {
						switch(k) {
						case 0:
							s = change(tomas.substring(0,j+1)) + change(tomas.substring(j+1,tomas.length()));
							pettern.add(s);
							break;
							
						case 1:
							s = change(tomas.substring(0,j+1)) + tomas.substring(j+1,tomas.length());
							pettern.add(s);
							break;
								
							
						case 2:
							s = tomas.substring(0,j+1) + change(tomas.substring(j+1,tomas.length()));
							pettern.add(s);
							break;
							
						case 3:
							s = tomas.substring(0,j+1) + tomas.substring(j+1,tomas.length());
							pettern.add(s);
							break;
							
						case 4:
							s = change(tomas.substring(j+1,tomas.length())) +  change(tomas.substring(0,j+1)) ;
							pettern.add(s);
							break;
							
						case 5:
							s = tomas.substring(j+1,tomas.length()) + change(tomas.substring(0,j+1)) ;
							pettern.add(s);
							break;
								
							
						case 6:
							s =  change(tomas.substring(j+1,tomas.length())) + tomas.substring(0,j+1) ;
							pettern.add(s);
							break;
							
						case 7:
							s = tomas.substring(j+1,tomas.length()) + tomas.substring(0,j+1) ;
							pettern.add(s);
							break;
							
						}
					}
				}
				
				int count=0;
				
				for(int l=0;l<pettern.sixe()-1;l++) {
					for(int n=l+1;n<pettern.size();n++) {
						if(!pettern.get(l).equals(pettern.get(n))) count++;
					}
				}
				
				System.out.println(count);
				
			}
		}

	}


Compiler output:
Main.java:73: error: cannot find symbol
				for(int l=0;l<pettern.sixe()-1;l++) {
				                     ^
  symbol:   method sixe()
  location: variable pettern of type ArrayList<String>
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;


public class Main {
	
	static String change(String str){
		StringBuffer sb = new StringBuffer(str);
		str = sb.reverse().toString();
		return str;
	}
	
	public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			int m = sc.nextInt();
			for(int i=0;i<m;i++) {
				String tomas = sc.next();
				ArrayList<String> pettern = new ArrayList<>();
				
				String s = "";
				
				for(int j=0;j<tomas.length()-1;j++) {
						
					s = change(tomas.substring(0,j+1)) + change(tomas.substring(j+1,tomas.length()));
					pettern.add(s);
							
					s = change(tomas.substring(0,j+1)) + tomas.substring(j+1,tomas.length());
					pettern.add(s);
						
					s = tomas.substring(0,j+1) + change(tomas.substring(j+1,tomas.length()));
					pettern.add(s);
						
					s = tomas.substring(0,j+1) + tomas.substring(j+1,tomas.length());
					pettern.add(s);
						
					s = change(tomas.substring(j+1,tomas.length())) +  change(tomas.substring(0,j+1)) ;
					pettern.add(s);
					
					s = tomas.substring(j+1,tomas.length()) + change(tomas.substring(0,j+1)) ;
					pettern.add(s);
						
					
					s =  change(tomas.substring(j+1,tomas.length())) + tomas.substring(0,j+1) ;
					pettern.add(s);
					
					s = tomas.substring(j+1,tomas.length()) + tomas.substring(0,j+1) ;
					pettern.add(s);
			
				}
				
				int count=0;
				
				for(int l=0;l<pettern.sixe()-1;l++) {
					for(int n=l+1;n<pettern.size();n++) {
						if(!pettern.get(l).equals(pettern.get(n))) count++;
					}
				}
				
				System.out.println(count);
				
			}
		}

	}


Compiler output:
Main.java:53: error: cannot find symbol
				for(int l=0;l<pettern.sixe()-1;l++) {
				                     ^
  symbol:   method sixe()
  location: variable pettern of type ArrayList<String>
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;


static String reverse(String str){
        return new StringBuffer(str).reverse().toString();
    }

    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)) {
            int m = sc.nextInt();
            for(int i=0;i<m;i++) {
                String tomas = sc.next();  // sc.nextInt() と sc.nextLine() は混在しない
                TreeSet<String> pats = new TreeSet<>();
                for(int j=0;j<tomas.length()-1;j++) {
                    String head = tomas.substring(0, j+1);
                    String tail = tomas.substring(j+1); // tomas.substring(j+1,tomas.length()) と同じ
                    pats.add(reverse(head) + tail);
                    pats.add(tail + reverse(head));
                    pats.add(reverse(tail) + head);
                    pats.add(head + reverse(tail));
                    pats.add(head + tail);
                    pats.add(tail + head);
                    pats.add(reverse(head) + reverse(tail));
                    pats.add(reverse(tail) + reverse(head));
                }
                System.out.print(pats);
                System.out.println(pats.size());
            }
        }
    }


Compiler output:
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
static String reverse(String str){
       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

import java.io.*;
import java.util.*;

class Main{
  public static Scanner cin;
  public static HashSet<String> m;

  public static String reverse(String s){
    return new StringBuilder(s).reverse().toString();
  }

  public static void main(String []args){
    cin=new Scanner(System.in);
    int j=0,n=cin.nextInt();
    cin.nextLine();
    for(;j<n;j++){
    String s=cin.nextLine();
    m=new HashSet<String>();
    int j=1;
    for(;i<s.length();i++){
      String s1=s.substring(0,i),s2=s.substring(i),r1=reverse(s1),r2=reverse(s2);
      m.add(s1+s2);
      m.add(r1+s2);
      m.add(s1+r2);
      m.add(r1+r2);
      m.add(s2+s1);
      m.add(r2+s1);
      m.add(s2+r1);
      m.add(r2+r1);
    }
    System.out.println(m.size());
    }
  }
  }
}

Compiler output:
Main.java:35: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.io.*;
import java.util.*;

class Main{
  public static Scanner cin;
  public static HashSet<String> m;

  public static String reverse(String s){
    return new StringBuilder(s).reverse().toString();
  }

  public static void main(String []args){
    cin=new Scanner(System.in);
    int j=0,n=cin.nextInt();
    cin.nextLine();
    for(;j<n;j++){
    String s=cin.nextLine();
    m=new HashSet<String>();
    int j=1;
    for(;i<s.length();i++){
      String s1=s.substring(0,i),s2=s.substring(i),r1=reverse(s1),r2=reverse(s2);
      m.add(s1+s2);
      m.add(r1+s2);
      m.add(s1+r2);
      m.add(r1+r2);
      m.add(s2+s1);
      m.add(r2+s1);
      m.add(s2+r1);
      m.add(r2+r1);
    }
    System.out.println(m.size());
    }
  }
}

Compiler output:
Main.java:19: error: variable j is already defined in method main(String[])
    int j=1;
        ^
Main.java:20: error: cannot find symbol
    for(;i<s.length();i++){
         ^
  symbol:   variable i
  location: class Main
Main.java:20: error: cannot find symbol
    for(;i<s.length();i++){
                      ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
      String s1=s.substring(0,i),s2=s.substring(i),r1=reverse(s1),r2=reverse(s2);
                              ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
      String s1=s.substring(0,i),s2=s.substring(i),r1=reverse(s1),r2=reverse(s2);
                                                ^
  symbol:   variable i
  location: class Main
5 errors
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>

typedef struct node{
  struct node *next['z'-'a'+1];
}node;

node *_N;
int _count;

node *allocNode(){
  return &_N[_count++];
}

#define MAX (72*(72*6)+2)
void init(){
  _N=(node *)calloc(sizeof(node),MAX);
  _count=0;
}
void reinit(){
  memset(_N,0,sizeof(node)*_count);
  _count=0;
}

node *get(node *s,const char *p){
  while(*p!='\0'){
    if(s==NULL) return NULL;
    s=s->next[*(p++)-'a'];
  }
  return s;
}

int set(node *s,const char *p){
  int ret=0;
  while(*p!='\0'){
    if(s->next[*p-'a']==NULL){
      s->next[*p-'a']=allocNode();
      ret=1;
    }
    s=s->next[*(p++)-'a'];
  }
  return ret;  
}

void makestr(char *dist,char *s1,char *s2){
  strcpy(dist,s1);
  strcat(dist,s2);
}

int main(){
  int n;
  init();
  scanf("%d ",&n);
  while(n-->0){
    char buff[100];
    char buff2[100];
    node *s=allocNode();
    int len,i,ans=0;
    char f[100],*b,*fr,br[100];

    len=strlen(gets(buff));
    for(i=0;i<len;i++){
      buff2[i]=buff[len-1-i];
      br[i]=buff[len-1-i];
    }
    buff2[len]='\0';
    b=buff;
    fr=&buff2[len];

    ans+=set(s,buff);
    ans+=set(s,buff2);

    for(i=1;i<len;i++){
      char str[100];
      f[i-1]=buff[i-1];f[i]='\0';
      br[len-1-(i-1)]='\0';
      fr--;b++;
      //printf("%s(%s) + %s(%s)\n",f,fr,b,br);
      makestr(str,fr,b ); ans+=set(s,str);
      makestr(str,fr,br); ans+=set(s,str);
      makestr(str,f ,br); ans+=set(s,str);
      makestr(str,b ,f ); ans+=set(s,str);
      makestr(str,br,f ); ans+=set(s,str);
      makestr(str,b ,fr); ans+=set(s,str);
    }
    
    printf("%d\n",ans);

    if(n!=0) reinit();
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:62:16: error: implicit declaration of function 'gets'; did you mean 'get'? [-Wimplicit-function-declaration]
   62 |     len=strlen(gets(buff));
      |                ^~~~
      |                get
main.c:62:16: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   62 |     len=strlen(gets(buff));
      |                ^~~~~~~~~~
      |                |
      |                int
In file included from main.c:3:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C

#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
 int n,s,sv1=0,sv=0;

 
 cin >> n; 
 
 set<string> v1;
 vector<int> v2(n);
 int i;
 for(i=0;i<n;i++){
  string tmp,tmp2,t1,t2;
  cin >> tmp;
  s = tmp.size();
  for(int j=1;j<s;j++){
    
   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   tmp2 = t1.append(t2);
   v1.insert(tmp2);
   
   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   tmp2 = t2.append(t1);
   v1.insert(tmp2);
  

   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t1.begin(), t1.end()); //t1は逆順
   tmp2 = t1.append(t2);
   v1.insert(tmp2);

   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t1.begin(), t1.end()); 
   tmp2 = t2.append(t1);
   v1.insert(tmp2);

 
   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t2.begin(), t2.end()); //t2は逆順
   tmp2 = t1.append(t2);
   v1.insert(tmp2);

   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t2.begin(), t2.end());
   tmp2 = t2.append(t1);
   v1.insert(tmp2);
  
   
   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t1.begin(), t1.end()); //t1は逆順
   reverse(t2.begin(), t2.end());
   tmp2 = t1.append(t2);
   v1.insert(tmp2);

   t1 = tmp.substr(0,j);
   t2 = tmp.substr(j);
   reverse(t1.begin(), t1.end()); //t1は逆順
   reverse(t2.begin(), t2.end());
   tmp2 = t2.append(t1);
   v1.insert(tmp2);

  }
  sv1 = v1.size() - sv;
  v2[i] = sv1;
  sv = v1.size();
  
 }
 //set<string>::iterator p;
 //for(p=v1.begin();p!=v1.end();p++)
 //cout << *p << endl;

 for(i=0;i<n;i++){
  cout << v2[i] << endl;
 }
 return 0;
}

Compiler output:
main.c:1:10: fatal error: set: No such file or directory
    1 | #include <set>
      |          ^~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int main()
{
	string s;
	cin >> s;

	set<string> a;

	int len = s.size();
	for (int i = 1; i < len; i++) {
		// 2個に分割する
		string f = s.substr(0, i);
		string b = s.substr(i, len - i);

		// 逆順の文字列を求める
		string bf = f;
		string bb = b;
		reverse(begin(bf), end(bf));	// 逆順にする
		reverse(begin(bb), end(bb));	// 逆順にする

		// 連結する
		a.insert(f + b);
		a.insert(b + f);
		a.insert(bf + b);
		a.insert(b + bf);
		a.insert(f + bb);
		a.insert(bb + f);
		a.insert(bf + bb);
		a.insert(bb + bf);
	}
	cout << a.size() << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'reverse' was not declared in this scope
   23 |                 reverse(begin(bf), end(bf));    // 逆順にする
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int main()
{
	string s;
	cin >> s;

	set<string> a;

	int len = s.size();
	for (int i = 1; i < len; i++) {
		// 2個に分割する
		string f = s.substr(0, i);
		string b = s.substr(i, len - i);

		// 逆順の文字列を求める
		string bf = f;
		string bb = b;
//		reverse(begin(bf), end(bf));	// 逆順にする
//		reverse(begin(bb), end(bb));	// 逆順にする

		reverse(bf.begin(), bf.end());	// 逆順にする
		reverse(bb.begin(), bb.end());	// 逆順にする


		// 連結する
		a.insert(f + b);
		a.insert(b + f);
		a.insert(bf + b);
		a.insert(b + bf);
		a.insert(f + bb);
		a.insert(bb + f);
		a.insert(bf + bb);
		a.insert(bb + bf);
	}
	cout << a.size() << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'reverse' was not declared in this scope
   26 |                 reverse(bf.begin(), bf.end());  // 逆順にする
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int main()
{
	string s;
	cin >> s;

	set<string> a;

	int len = s.size();
	for (int i = 1; i < len; i++) {
		// 2個に分割する
		string f = s.substr(0, i);
		string b = s.substr(i, len - i);

		// 逆順の文字列を求める
		string bf = f;
		string bb = b;
//		reverse(begin(bf), end(bf));	// 逆順にする
//		reverse(begin(bb), end(bb));	// 逆順にする


		std::reverse(bf.begin(), bf.end());	// 逆順にする
		std::reverse(bb.begin(), bb.end());	// 逆順にする


		// 連結する
		a.insert(f + b);
		a.insert(b + f);
		a.insert(bf + b);
		a.insert(b + bf);
		a.insert(f + bb);
		a.insert(bb + f);
		a.insert(bf + bb);
		a.insert(bb + bf);
	}
	cout << a.size() << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'reverse' is not a member of 'std'
   27 |                 std::reverse(bf.begin(), bf.end());     // 逆順にする
      |                      ^~~~~~~
a.cc:28:22: error: 'reverse' is not a member of 'std'
   28 |                 std::reverse(bb.begin(), bb.end());     // 逆順にする
      |                      ^~~~~~~
Language: C++


//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>


using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define loop(n) FOR(i,0,n)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

string getreverse(string str) {
	reverse(str.begin(), str.end());

	return str;
}

int main() {
	int n; cin >> n;

	for (int t = 0; t < n; t++) {
		string s; cin >> s;

		set<string> set;

		for (int i = 1; i < s.size(); i++) {
			string forward = s.substr(0, i);
			string back = s.substr(i,s.size());

			set.insert(forward+back);
			set.insert(forward+getreverse(back));

			set.insert(getreverse(forward+ back);
			set.insert(getreverse(forward)+ getreverse(back));
			
			set.insert(back+ forward);
			set.insert(back+ getreverse(forward));

			set.insert(getreverse(back)+ forward);
			set.insert(getreverse(back)+ getreverse(forward));
		}

		cout << set.size() << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:94:61: error: expected ')' before ';' token
   94 |                         set.insert(getreverse(forward+ back);
      |                                   ~                         ^
      |                                                             )
Language: C++

#include <iostream>
#include <set>
#inlude <algorithm>
using namespace std;

int main(){
	int m; cin >> m;
	string s;
	for(int i=0; i<m; i++){
		cin >> s;
		set<string> ss;
		ss.insert(s);
		for(int j=1; j<s.size(); j++){
			string l = s.substr(0, j);
			string r = s.substr(j, n-j);
			ss.insert(r+l);
			reverse(l.begin(), l.end());
			ss.insert(l+r);
			ss.insert(r+l);
			reverse(r.begin(), r.end());
			ss.insert(l+r);
			ss.insert(r+l);
			reverse(l.begin(), l.end());
			ss.insert(l+r);
			ss.insert(r+l);
		}
		cout << ss.size() << endl;
	}
}


Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlude; did you mean #include?
    3 | #inlude <algorithm>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:15:48: error: 'n' was not declared in this scope
   15 |                         string r = s.substr(j, n-j);
      |                                                ^
a.cc:17:25: error: 'reverse' was not declared in this scope
   17 |                         reverse(l.begin(), l.end());
      |                         ^~~~~~~
Language: C++

#include <iostream>
#include <set>
#inlude <algorithm>
using namespace std;

int main(){
	int m; cin >> m;
	string s;
	for(int i=0; i<m; i++){
		cin >> s;
		set<string> ss;
		ss.insert(s);
		for(int j=1; j<s.size(); j++){
			string l = s.substr(0, j);
			string r = s.substr(j, s.size()-j);
			ss.insert(r+l);
			reverse(l.begin(), l.end());
			ss.insert(l+r);
			ss.insert(r+l);
			reverse(r.begin(), r.end());
			ss.insert(l+r);
			ss.insert(r+l);
			reverse(l.begin(), l.end());
			ss.insert(l+r);
			ss.insert(r+l);
		}
		cout << ss.size() << endl;
	}
}


Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlude; did you mean #include?
    3 | #inlude <algorithm>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:17:25: error: 'reverse' was not declared in this scope
   17 |                         reverse(l.begin(), l.end());
      |                         ^~~~~~~
Language: C++

#include <iostream>
#include <cstring>
#include <set>
using namespace std;
set<string> S;

void count_str(string str1, string str2){
    string rstr1 = str1;
    string rstr2 = str2;
    reverse(rstr1.begin(), rstr1.end());
    reverse(rstr2.begin(), rstr2.end());
    
    S.insert(str1+str2);
    S.insert(str1+rstr2);
    S.insert(rstr1+str2);
    S.insert(rstr1+rstr2);
    S.insert(str2+str1);
    S.insert(str2+rstr1);
    S.insert(rstr2+str1);
    S.insert(rstr2+rstr1);
}

int main()
{
    int m;
    string str, str1, str2;
    cin >> m;
    for (int k = 0; k < m; k++) {
        cin >> str;
        S.clear();
        for (int i = 1; i < str.size(); i++) {
            str1 = "";
            str2 = "";
            for (int j = 0; j < i; j++) {
                str1 += str[j];
            }
            for (int j = i; j < str.size(); j++) {
                str2 += str[j];
            }
            count_str(str1, str2);
        }
        cout << (unsigned int)S.size() << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'void count_str(std::string, std::string)':
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(rstr1.begin(), rstr1.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>
using namespace std;

int main(){
  int m;
  cin >> m;

  for(int i=0;i<m;i++){
    string train;
    cin >> train;
    set<string> st;
    for( int i = 1, length = train.length() ; i < length ; ++i ){
      string forward, backward;
      forward = train.substr(0,i);
      backward = train.substr(i, length-i);
      st.insert(forward+backward);
      st.insert(backward+forward);
      reverse(backward.begin(), backward.end());
      st.insert(forward+backward);
      st.insert(backward+forward);
      reverse(forward.begin(), forward.end());
      st.insert(forward+backward);
      st.insert(backward+forward);
      reverse(backward.begin(), backward.end());
      st.insert(forward+backward);
      st.insert(backward+forward);
    }
    cout << st.size() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'reverse' was not declared in this scope
   20 |       reverse(backward.begin(), backward.end());
      |       ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 

int main(){
  int n;
  cin >> n;
  REP(i,n){
        string str;
        cin >> str;
        int l=str.length();
        set<string> lines;
        for(int j=1;j<=l-1;j++){
            string sub1=str.substr(0,j);
            string sub2=str.substr(j);
            string subs[]={sub1,sub2,sub1.reverse(),sub2.reverse()};
            REP(k,4)REP(m,4){
                if((k-m)%2) lines.insert(subs[k]+subs[m]);
            }
        }
        cout << lines.size() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'set' was not declared in this scope
   23 |         set<string> lines;
      |         ^~~
a.cc:6:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    5 | #include <iomanip>
  +++ |+#include <set>
    6 | 
a.cc:23:19: error: expected primary-expression before '>' token
   23 |         set<string> lines;
      |                   ^
a.cc:23:21: error: 'lines' was not declared in this scope
   23 |         set<string> lines;
      |                     ^~~~~
a.cc:27:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'reverse'; did you mean 'reserve'?
   27 |             string subs[]={sub1,sub2,sub1.reverse(),sub2.reverse()};
      |                                           ^~~~~~~
      |                                           reserve
a.cc:27:58: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'reverse'; did you mean 'reserve'?
   27 |             string subs[]={sub1,sub2,sub1.reverse(),sub2.reverse()};
      |                                                          ^~~~~~~
      |                                                          reserve
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

set<string> set_string;

void strage_lines(string up, string down, string depture_line, string reversal_line){
	if (up.size() == 0 && down.size() == 0 && reversal_line.size() == 0){
		set_string.insert(depture_line);
	}
	else{
		if (up.size() != 0){
			strage_lines("", down, depture_line + up, reversal_line);
			strage_lines("", down, depture_line, reversal_line + up);
		}
		if (down.size() != 0){
			strage_lines(up, "", depture_line + down, reversal_line);
			strage_lines(up, "", depture_line, reversal_line + down);
		}
		if (reversal_line.size() != 0){
			reverse(reversal_line.begin(), reversal_line.end());
			strage_lines(up, down, depture_line + reversal_line, "");
		}
	}
	
}


void arrival_line(string col){
	for (int i = 1; i < col.size(); i++){
		string up = "";
		string down = "";
		up = col.substr(0, i);
		down = col.substr(i, col.size() - i);
		strage_lines(up, down, "", "");
	}
}


int main(void){
	string str;
	cin >> str;
	arrival_line(str);
	cout << set_string.size() << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void strage_lines(std::string, std::string, std::string, std::string)':
a.cc:23:25: error: 'reverse' was not declared in this scope
   23 |                         reverse(reversal_line.begin(), reversal_line.end());
      |                         ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

set<string> set_string;

void strage_lines(string up, string down, string depture_line, string reversal_line){
	if (up.size() == 0 && down.size() == 0 && reversal_line.size() == 0){
		set_string.insert(depture_line);
	}
	else{
		if (up.size() != 0){
			strage_lines("", down, depture_line + up, reversal_line);
			strage_lines("", down, depture_line, reversal_line + up);
		}
		if (down.size() != 0){
			strage_lines(up, "", depture_line + down, reversal_line);
			strage_lines(up, "", depture_line, reversal_line + down);
		}
		if (reversal_line.size() != 0){
			reverse(reversal_line.begin(), reversal_line.end());
			strage_lines(up, down, depture_line + reversal_line, "");
		}
	}
	
}


void arrival_line(string col){
	for (int i = 1; i < col.size(); i++){
		string up = "";
		string down = "";
		up = col.substr(0, i);
		down = col.substr(i, col.size() - i);
		strage_lines(up, down, "", "");
	}
}


int main(void){
	string str;
	int m;
	cin >> m;
	for (int i = 0; i < m; i++){
		cin >> str;
		set_string.clear();
		arrival_line(str);
		cout << set_string.size() << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void strage_lines(std::string, std::string, std::string, std::string)':
a.cc:23:25: error: 'reverse' was not declared in this scope
   23 |                         reverse(reversal_line.begin(), reversal_line.end());
      |                         ^~~~~~~
Language: C++

#include<iostream>
#include<cstring>
#include<cstdlib>
#include<set>
using namespace std;

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    string str;
    string f,b;
    set<string> set;
    cin>>str;
    set.insert(str);
    for(int j=1;j<str.size();j++){
    f=str.substr(0,j);
    b=str.substr(j);
    set.insert(b+f);
    reverse(f.begin(),f.end());
    set.insert(f+b);
    set.insert(b+f);
    reverse(b.begin(),b.end());
    set.insert(b+f);
    set.insert(f+b);
    reverse(f.begin(),f.end());
    set.insert(b+f);
    set.insert(f+b);
    }
    cout<<set.size()<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'reverse' was not declared in this scope
   20 |     reverse(f.begin(),f.end());
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <cstring>
#include <set>
using namespace std;

set<string> st;

int main(void){
  int m;
  string train;
  cin >> m;
  for(int i = 0; i < m; i++){
    cin >> train;

    st.clear();
    for(int j = 1; j <= train.size(); j++){
      int a = j;
      string c1o, c2o, c1u, c2u;

      for(int i = 0; i < a; i++) c1u += train[i];
      c1o = c1u;
      reverse(c1u.begin(), c1u.end());
      for(int i = a; i < train.size(); i++) c2u += train[i];
      c2o = c2u;
      reverse(c2u.begin(), c2u.end());

      st.insert(c1o + c2o);
      st.insert(c1o + c2u);
      st.insert(c1u + c2o);
      st.insert(c1u + c2u);
      st.insert(c2o + c1o);
      st.insert(c2o + c1u);
      st.insert(c2u + c1o);
      st.insert(c2u + c1u);
    }

    cout << st.size() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: 'reverse' was not declared in this scope
   22 |       reverse(c1u.begin(), c1u.end());
      |       ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>

using namespace std;

namespace Solver {

    int M;
    vector<string> ds;
    inline void Read() {
        cin >> M;
        ds.resize(M);
        for (int i = 0; i < M; i++) cin >> ds[i];
    }

    inline void Work() {
        for (int i = 0; i < M; i++) {
            set<string> ss;
            for (int j = 1; j < ds[i].length(); j++) {
                vector<string> s(4);
                s[0] = ds[i].substr(0, j);
                s[1] = ds[i].substr(0, j);
                s[2] = ds[i].substr(j);
                s[3] = ds[i].substr(j);
                reverse(s[1].begin(), s[1].end());
                reverse(s[3].begin(), s[3].end());

                for (int l = 0; l < 2; l++) {
                    for (int m = 2; m < 4; m++) {
                        if (l == m) continue;
                        ss.insert(s[l] + s[m]);
                        ss.insert(s[m] + s[l]);
                    }
                }

            }

            cout << ss.size() << endl;
        }
    }

    inline void Solve() {
        Read();
        Work();
    }
}

int main() {
    Solver::Solve();
}

Compiler output:
a.cc: In function 'void Solver::Work()':
a.cc:27:17: error: 'reverse' was not declared in this scope
   27 |                 reverse(s[1].begin(), s[1].end());
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algoritm>

using namespace std;

namespace Solver {

    int M;
    vector<string> ds;
    inline void Read() {
        cin >> M;
        ds.resize(M);
        for (int i = 0; i < M; i++) cin >> ds[i];
    }

    inline void Work() {
        for (int i = 0; i < M; i++) {
            set<string> ss;
            for (int j = 1; j < ds[i].length(); j++) {
                vector<string> s(4);
                s[0] = ds[i].substr(0, j);
                s[1] = ds[i].substr(0, j);
                s[2] = ds[i].substr(j);
                s[3] = ds[i].substr(j);
                reverse(s[1].begin(), s[1].end());
                reverse(s[3].begin(), s[3].end());

                for (int l = 0; l < 2; l++) {
                    for (int m = 2; m < 4; m++) {
                        if (l == m) continue;
                        ss.insert(s[l] + s[m]);
                        ss.insert(s[m] + s[l]);
                    }
                }

            }

            cout << ss.size() << endl;
        }
    }

    inline void Solve() {
        Read();
        Work();
    }
}

int main() {
    Solver::Solve();
}

Compiler output:
a.cc:5:10: fatal error: algoritm: No such file or directory
    5 | #include <algoritm>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
using namespace std;

int main(){
	long m;
	scanf(" %ld", &m);
	for(long i=0; i<m; ++i){
		string s;
		string list[5000];
		long count=0;
		
		cin >> s;
		long size=s.size();
		
		for(int j=1; j<=size-1; ++j){
			string a=s.substr(0,j)	;
			string b=s.substr(j,size-j);
			
			for(int p=0; p<2; ++p){
				if(p) reverse(a.begin(), a.end());
				
				for(int q=0; q<2; ++q){
					reverse(b.begin(), b.end());
					
					for(int r=0; r<2; ++r){
						string tmp="";
						if(r==0) tmp+=b+a;
						else tmp+=a+b;
						//cout << tmp <<endl;
						
						bool flag=true;
						for(long x=0; x<count; ++x){
							if(tmp==list[x]){
								flag=false;
								break;	
							}	
						}
						
						if(flag) list[count++]=tmp;
							
					}
				}
				
			}
			
		}
		
		//for(long x=0; x<count; ++x) cout << " " << list[x] << endl;
		
		printf("%ld\n", count);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:39: error: 'reverse' was not declared in this scope
   22 |                                 if(p) reverse(a.begin(), a.end());
      |                                       ^~~~~~~
a.cc:25:41: error: 'reverse' was not declared in this scope
   25 |                                         reverse(b.begin(), b.end());
      |                                         ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<set>
using namespace std;

string reverse(string str){
	reverse(str.begin(),str.end());
	return str;
}

int getPattern(string str){
	set<string> s;
	for(int i=0;i<str.size();i++){
		string sub1 = str.substr(0,i);
		string sub2 = str.substr(i,str.size());
		s.insert(reverse(sub1)+sub2);
		s.insert(sub1+reverse(sub2));
		s.insert(reverse(sub2)+sub1);
		s.insert(sub2+reverse(sub1));
		s.insert(reverse(sub2)+reverse(sub1));
		s.insert(reverse(sub1)+reverse(sub2));		
		s.insert(sub2+sub1);
		// s.insert(sub1+sub2);		
	}
	return s.size();
}

int main(){

	int n;
	cin >>n;
	while(n--){
		string str;
		cin >> str;
		cout<<getPattern(str)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::string reverse(std::string)':
a.cc:7:26: error: could not convert 'str.std::__cxx11::basic_string<char>::begin()' from 'std::__cxx11::basic_string<char>::iterator' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    7 |         reverse(str.begin(),str.end());
      |                 ~~~~~~~~~^~
      |                          |
      |                          std::__cxx11::basic_string<char>::iterator
Language: C++

#include<iostream>
#include<string>
#include<set>
using namespace std;

string rev(string str){
	reverse(str.begin(),str.end());
	return str;
}

int getPattern(string str){
	set<string> s;
	for(int i=0;i<str.size();i++){
		string sub1 = str.substr(0,i);
		string sub2 = str.substr(i,str.size());
		s.insert(rev(sub1)+sub2);
		s.insert(sub1+rev(sub2));
		s.insert(rev(sub2)+sub1);
		s.insert(sub2+rev(sub1));
		s.insert(rev(sub2)+rev(sub1));
		s.insert(rev(sub1)+rev(sub2));		
		s.insert(sub2+sub1);
		// s.insert(sub1+sub2);		
	}
	return s.size();
}

int main(){

	int n;
	cin >>n;
	while(n--){
		string str;
		cin >> str;
		cout<<getPattern(str)<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::string rev(std::string)':
a.cc:7:9: error: 'reverse' was not declared in this scope
    7 |         reverse(str.begin(),str.end());
      |         ^~~~~~~
Language: C++

#include <vector>
#include <string>
#include <iostream>

using namespace std;

int main(void)
{
	vector<string> str;
	string s;
	
	cin >> s;
	
	for (unsigned int i = 0; i < s.size(); i++){
		string str1(s.substr(0, i));
		string str2(s.substr(i, s.size() - i));
		str.push_back(str1 + str2);
		str.push_back(str2 + str1);
		
		reverse(str1.begin(), str1.end());
		str.push_back(str1 + str2);
		str.push_back(str2 + str1);
		
		reverse(str1.begin(), str1.end());
		reverse(str2.begin(), str2.end());
		str.push_back(str1 + str2);
		str.push_back(str2 + str1);
		
		reverse(str1.begin(), str1.end());
		str.push_back(str1 + str2);
		str.push_back(str2 + str1);
	}
	
	unsigned int n = 0;
	for (unsigned int i = 0; i < str.size() - 1; i++){
		bool f = true;
		for (unsigned int j = i + 1; j < str.size(); j++){
			if (str[i] == str[j]){
				f = false;
				break;
			}
		}
		if (f){
			n++;
		}
	}
	
	cout << n + 1 << endl;
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'reverse' was not declared in this scope
   20 |                 reverse(str1.begin(), str1.end());
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int solve(string cars);

int main(){
	int n;
	string word;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> word;
		cout << solve(string word) << endl;
	}
}

int solve(string cars){
	set<string> s;
	int n = cars.length;
	for (int i = 1; i < n; i++){
		string a = substr(0, i);
		string b = substr(i);
		s.insert(cars);
		s.insert(b + a);
		s.insert(reverse(a.begin(), a.end()) + b);
		s.insert(b + reverse(a.begin(), a.end()));
		s.insert(a + reverse(b.begin(), b.end()));
		s.insert(reverse(b.begin(), b.end()) + a);
		s.insert(reverse(a.begin(), a.end()) + reverse(b.begin(), b.end()));
		s.insert(reverse(cars.begin(), cars.end()));
	}
	return s.size();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected primary-expression before 'word'
   15 |                 cout << solve(string word) << endl;
      |                                      ^~~~
a.cc: In function 'int solve(std::string)':
a.cc:21:22: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
   21 |         int n = cars.length;
      |                      ^~~~~~
a.cc:23:28: error: 'substr' was not declared in this scope
   23 |                 string a = substr(0, i);
      |                            ^~~~~~
a.cc:27:26: error: 'reverse' was not declared in this scope
   27 |                 s.insert(reverse(a.begin(), a.end()) + b);
      |                          ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int solve(string s){
    typedef set<string> set_s;
    set_s S;
    for(int i=1;i<s.size();i++){
        string s1,s1r,s2,s2r,kouho1,kouho2,kouho3,kouho4,kouho5,kouho6,kouho7,kouho8;
        s1r = s.substr(0,i);
        reverse(s1r.begin(),s1r.end());
        s2r = s.substr(i);
        reverse(s2r.begin(),s2r.end());
        s1 = s.substr(0,i);
        s2 = s.substr(i);

        kouho1 = s1 + s2;
        kouho2 = s1 + s2r;
        kouho3 = s1r + s2;
        kouho4 = s1r + s2r;
        kouho5 = s2 + s1;
        kouho6 = s2 + s1r;
        kouho7 = s2r + s1;
        kouho8 = s2r + s1r;

        S.insert(kouho1);
        S.insert(kouho2);
        S.insert(kouho3);
        S.insert(kouho4);
        S.insert(kouho5);
        S.insert(kouho6);
        S.insert(kouho7);
        S.insert(kouho8);
    }
    return S.size();
}

int main(){
    int n;
    cin >> n;
    string s;
    for(int i=0;i<n;i++){
        cin >> s;
        cout << solve(s) << endl;
    }
}

Compiler output:
a.cc: In function 'int solve(std::string)':
a.cc:13:9: error: 'reverse' was not declared in this scope
   13 |         reverse(s1r.begin(),s1r.end());
      |         ^~~~~~~
Language: C++

#include <set>
#include <string>
#include <iostream>

using namespace std;

int main()
{
    string S; int n;
    
    set<string> T;
    
    scanf("%d", &n);
    
    while(n--)
    {
        cin >> S;
        
        int c = 0;
        
        for(int i = 1; i < S.size(); i++)
        {
            c += (S[i - 1] == S[i] ? 1 : 0);
        }
        
        if(c + 1 == S.size())
        {
            printf("1\n");
        }
        else
        {
            T.clear();
            
            for(int j = 1; j < S.size(); j++)
            {
                string A = S.substr(0, j);
                string B = S.substr(j, S.size() - j);
                
                string C = A; reverse(C.begin(), C.end());
                string D = B; reverse(D.begin(), D.end());
                
                T.insert(A + B);
                T.insert(B + A);
                T.insert(A + D);
                T.insert(D + A);
                T.insert(C + B);
                T.insert(B + C);
                T.insert(C + D);
                T.insert(D + C);
            }
            
            printf("%d\n", T.size());
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:31: error: 'reverse' was not declared in this scope
   39 |                 string C = A; reverse(C.begin(), C.end());
      |                               ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <set>

using namespace std;

int main()
{
  int n;
  cin >> n;
  while(n--){
    set<string> district;
    string train;
    cin >> train;
    for(int i = 0; i < train.size(); i++){
      string f = train.substr(0, i);
      string b = train.substr(i, train.size() - i);
      reverse(f.begin(), f.end());
      district.insert(f + b);
      district.insert(b + f);
      reverse(b.begin(), b.end());
      district.insert(f + b);
      district.insert(b + f);
      reverse(f.begin(), f.end());
      district.insert(f + b);
      district.insert(b + f);
      reverse(b.begin(), b.end());
      district.insert(f + b);
      district.insert(b + f);    
    }
    cout << district.size() << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'reverse' was not declared in this scope
   18 |       reverse(f.begin(), f.end());
      |       ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;

int main(){
  int m;
  scanf("%d",&m);
  while(m-->0){

    set <string> s;
    string t;
    cin >> t;

    s.insert(t);
    reverse(all(t));
    s.insert(t);
    reverse(all(t));

    rep1(i,t.size()){
      string t1 = t.substr(0,i);
      string t2 = t.substr(i,t.size());

      string F2F1 = t2 + t1; s.insert(F2F1);
      reverse(all(t2));
      string R2F1 = t2 + t1; s.insert(R2F1);
      string F1R2 = t1 + t2; s.insert(F1R2);
      reverse(all(t1));
      string R1R2 = t1 + t2; s.insert(R1R2);
      string R2R1 = t2 + t1; s.insert(R2R1);
      reverse(all(t2));
      string F2R1 = t2 + t1; s.insert(F2R1);
      string R1F2 = t1 + t2; s.insert(R1F2);

    }
    cout << s.size() << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'i' was not declared in this scope
   20 |     rep1(i,t.size()){
      |          ^
a.cc:20:5: error: 'rep1' was not declared in this scope; did you mean 'rep'?
   20 |     rep1(i,t.size()){
      |     ^~~~
      |     rep