criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;



public class Main {


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		FastScanner fc = new FastScanner();
		int num = fc.nextInt();
		int q =fc.nextInt();
		String str = sc.next();
		String subStr = "";
		for (int k = 0; k < q; k++) {
			subStr = str.substring(sc.nextInt() - 1, sc.nextInt());
			System.out.println((subStr.length() - subStr.replaceAll("AC", "").length()) / 2);
			System.gc();
		}
	}


}


Compiler output:
Main.java:10: error: cannot find symbol
		FastScanner fc = new FastScanner();
		^
  symbol:   class FastScanner
  location: class Main
Main.java:10: error: cannot find symbol
		FastScanner fc = new FastScanner();
		                     ^
  symbol:   class FastScanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int Q;
  int l;
  int r;
  string S;
  cin >> N >> Q >> S;
  int i=0;
  while (i<Q){//
    cin >> l >> r ;
    
    kouho =0;
    for (int j = 0; j < (L-i); j++) {
      k = S.at(i+j);
    if ( k == "A" ||k == "T" || k == "G" || k == "C"  ){
      kouho ++ ;
    }
    else {
      answer = max(answer,kouho);
      break;
    }
    }
    i++;
    
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'kouho' was not declared in this scope
   15 |     kouho =0;
      |     ^~~~~
a.cc:16:26: error: 'L' was not declared in this scope
   16 |     for (int j = 0; j < (L-i); j++) {
      |                          ^
a.cc:17:7: error: 'k' was not declared in this scope
   17 |       k = S.at(i+j);
      |       ^
a.cc:22:7: error: 'answer' was not declared in this scope
   22 |       answer = max(answer,kouho);
      |       ^~~~~~
a.cc:29:11: error: 'answer' was not declared in this scope
   29 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,q; cin >> n >> q;
    string s; cin >> s;
    vector<int> l(q),r(q);
    int ans;
    for(int i = 0; i < q; i++)
    {
        ans = 0;
        cin >> l[i] >> r[i];
    }
    vector<int> cnt;
    for(int i = 0; i < n - 1; i++)
    {
        if(s[i] == 'A' && s[i+1] == 'C')
        {
            cnt.push_back(i);
        } 
    }
    for(int i = 0; i < q; i++)
    {
        ans = 0;
        for(int j:cnt; j >= l[i]-1 && j < r[i]-1;)
        {
            if(j >= l[i]-1 && j < r[i]-1)
            {
                ans++;
            }
            if(j >= r[i]-1)
            {
                break;
            }
        }
        cout << ans << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ')' before ';' token
   25 |         for(int j:cnt; j >= l[i]-1 && j < r[i]-1;)
      |            ~         ^
      |                      )
a.cc:25:24: error: 'j' was not declared in this scope
   25 |         for(int j:cnt; j >= l[i]-1 && j < r[i]-1;)
      |                        ^
a.cc:25:50: error: expected primary-expression before ')' token
   25 |         for(int j:cnt; j >= l[i]-1 && j < r[i]-1;)
      |                                                  ^
Language: Java


public class Main {
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		scanner.nextLine();
		String input = scanner.nextLine().split(" ")[0];
		while (scanner.hasNext()) {
			String[] area = scanner.nextLine().split(" ");
			int start = Integer.valueOf(area[0]);
			int end = Integer.valueOf(area[1]);

			String temp = input.substring(start, end);

			int count = 0;
			char before = 0;
			for (char c : temp.toCharArray()) {
				if (before == 'A' && c == 'C') {
					count++;
					before = 0;
					continue;
				}
				before = c;
			}
			System.out.println(count);
		}
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
		Scanner scanner = new Scanner(System.in);
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  
  string S;
  int N, Q;
  vector<int> L(10000);
  vector<int> R(10000);
  vector<int> Ans(10000);
  
  cin >> N >>Q;
  cin >> S;
  
  for(int i=0;i<Q;i++){
    cin >> L.at(i);
    cin >> R.at(i);
  }
  for(int i=0;i<Q;i++){
    for(int j=L.at(i)-1;j<R.at(i)-2;j++){
      if(S.at(j)=='A' && S.at(j+1)=='C'){
        Ans.at(i) +=1;
      }
    }
  }
  for(int i=0;i<Q;i++){
    cout << Ans.at(i) << endl;
  }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> L(10000);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> L(10000);
      |          ^~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> R(10000);
      |          ^~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> Ans(10000);
      |          ^~~
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> N >>Q;
      |   ^~~
a.cc:13:10: error: 'S' was not declared in this scope
   13 |   cin >> S;
      |          ^
a.cc:16:12: error: 'L' was not declared in this scope
   16 |     cin >> L.at(i);
      |            ^
a.cc:17:12: error: 'R' was not declared in this scope
   17 |     cin >> R.at(i);
      |            ^
a.cc:20:15: error: 'L' was not declared in this scope
   20 |     for(int j=L.at(i)-1;j<R.at(i)-2;j++){
      |               ^
a.cc:20:27: error: 'R' was not declared in this scope
   20 |     for(int j=L.at(i)-1;j<R.at(i)-2;j++){
      |                           ^
a.cc:22:9: error: 'Ans' was not declared in this scope
   22 |         Ans.at(i) +=1;
      |         ^~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << Ans.at(i) << endl;
      |     ^~~~
a.cc:27:13: error: 'Ans' was not declared in this scope
   27 |     cout << Ans.at(i) << endl;
      |             ^~~
a.cc:27:26: error: 'endl' was not declared in this scope
   27 |     cout << Ans.at(i) << endl;
      |                          ^~~~
Language: C

#includes<stdio.h>
int main()
{
	int N, Q,Sac[100002],size;
	char S[100002];
	scanf("%d%d%s", &N, &Q, S);
	size = 0;
	for (int i = 0; i < N-1; i++)
	{
		if (S[i] == 'A')
			if (S[i + 1] == 'C')
				Sac[size++] = i;
	}
	for (int i = 0; i < Q; i++)
	{
		int l, r,cnt = 0;
		scanf("%d%d", &l, &r);
		for (int j = 0; j < size; j++)
		{
			if (Sac[j] >= l - 1 && Sac[j] < r-1)
				cnt++;
		}
		printf("%d\n", cnt);
	}
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #includes; did you mean #include?
    1 | #includes<stdio.h>
      |  ^~~~~~~~
      |  include
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d%d%s", &N, &Q, S);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #includes<stdio.h>
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d%d%s", &N, &Q, S);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:23:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   23 |                 printf("%d\n", cnt);
      |                 ^~~~~~
main.c:23:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:23:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:23:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main(){
  int N,Q;
  scanf("%d %d",&N,&Q);
  char S[N+1];
  scanf("%s",&S);
  int l[Q],r[Q];

  while(int i=0;i<Q;i++){
    scanf("%d %d",&l[i],&r[i]);
  }
  for(int j=0;j<Q;j++){
    int index=l[j],counter=0;
    while(index<r[j]){
      if(S[index]=='A' && S[index+1]=='C'){
        counter++;
        index++;
      }
    }
    printf("%d\n",counter);
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: expected expression before 'int'
   10 |   while(int i=0;i<Q;i++){
      |         ^~~
main.c:11:22: error: 'i' undeclared (first use in this function)
   11 |     scanf("%d %d",&l[i],&r[i]);
      |                      ^
main.c:11:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main() {
	int N, Q, i;
	char *s;
	scanf("%d %d\n", &N, &Q);
	scanf("%s\n", s);
	int l[Q]; r[Q];
	int count[i];
	for (i = 0; i < Q; i++)scanf("%d %d\n", &l[i], &r[i]);
	for (i = 0; i < Q; i++) {
		for (int j = l[i] - 1; j < r[i] - 1; j++) {
			if (s[j] == 'A' && s[j + 1] == 'C')count[i]++;
		}
	}
	for (i = 0; i < Q; i++) {
		printf("%d\n", count[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:19: error: 'r' undeclared (first use in this function)
    8 |         int l[Q]; r[Q];
      |                   ^
main.c:8:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;

int main()
{
  int n,q;
  cin>>n; cin>>q;
   char a[n+1];
   getchar();
  gets(a);
int dp[n+1][n+1];
memset(dp,0,sizeof(dp));


  for(int i=1;i<=n;i++)
  {
      for(int j=i+1;j<=n;j++)
      {
          if(a[j-2]=='A'&&a[j-1]=='C')
            dp[i][j]=dp[i][j-2]+1;
          else
            dp[i][j]=dp[i][j-1];

      }
  }


   while(q--)
   {
       int c,b;
     scanf("%d%d",&c,&b);
      printf("%d\n",dp[c][b]);

   }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |   gets(a);
      |   ^~~~
      |   getw
Language: C

#include<stdio.h>

int main{
    int n,q;
    int l,r;
    int count;
scanf("%s",&n);
scanf("%s",&q);
char s[n];
for(int j=0;j>n;j++){//文字列Sを取り込む
scanf("%c",&s[j]);
}
for(int i=0;q>i;i++){//q問分繰り返す
    for(int d=0;d>r-l;d++){//l-rの分だけ繰り返すs[l+d]
if(s[l+d]=='A'&&s[l+d+1]=='c'){
count++;
}
    }
    printf("%d\n",count);
}
}

Compiler output:
main.c:3:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | int main{
      |         ^
Language: C++

# include <bits/stdc++.h>
using namespace std;
 
long long main()
{
	long long N, Q;
	string S;
	string b;
	cin >> N >> Q >> S;

	for (long long i = 0; i < Q; ++i)
	{
		long long count;
		long long l_i, r_i;
		cin >> l_i >> r_i;
		for (long long j = l_i; j < N - r_i; ++j)
		{
			b = S.substr(j, 2);
			if (b == "AC")
			{
				++count;
			}
		}
		cout << count << endl;
	}
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int q = sc.nextInt();
		String str = sc.next();
		int count =0;
		String subStr="";
		for(int k =0;k<q;k++) {
			  subStr = str.substring(sc.nextInt()-1,sc.nextInt();
			  count=( subStr.length()-subStr.replaceAll("AC", "").length())/2;
			  System.out.println(count);
			  count=0;
		}

	}
}

Compiler output:
Main.java:12: error: ')' or ',' expected
			  subStr = str.substring(sc.nextInt()-1,sc.nextInt();
			                                                    ^
1 error
Language: C++

#include "bits/stdc++.h"
#define ll long long
using namespace std;
int main(){
string s;
ll N,Q;
cin>>N>>Q>>s;
vector<ll> qs(Q);
vector<ll> qe(Q);
vector<ll> ans(Q);
for(ll i=0;i<Q;i++){
cin>>qs[i]>>qe[i];
}


for(ll i=0;i<Q;i++){
  ll tmp=0;
  ll count =0;
  for(ll j=qs[i];j<qe[i];j++){
    switch(s[j]){
    case 'C':{
      if(s[j-1]=='A'){
       tmp++;
    }
    }
  }




ans[i] = tmp;
}

for(ll i=0;i<Q;i++){
printf("%lld\n",ans[i]);
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include<stdio.h>

int main()
{
    char s[200000]
int l[200000],r[200000],answer[200000];
    int i=0,j=0,num=0,max=0,n=0,q=0;
   
   scanf("%d%d",&n,&q);
   scanf("%s",s);
   for(i=0; i<q; i++)
   {
       answer[i]=0;
       scanf("%d%d",&l[i],&r[i]);
   }

   for(i=0; i<q; i++)
   {
      for(j=l[i]; j<r[i]-1; j++)
      {
          if(s[j]=='C' && s[j-1]=='A')
          {
              answer[i]+=1;
          }
      }
   }

   for(i=0; i<q; i++)
   {
       if(i != 0)
       {
           printf("\n");
       }
       printf("%d",answer[i]);
   }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:19: error: expected ';' before 'int'
    5 |     char s[200000]
      |                   ^
      |                   ;
    6 | int l[200000],r[200000],answer[200000];
      | ~~~                
main.c:10:15: error: 's' undeclared (first use in this function)
   10 |    scanf("%s",s);
      |               ^
main.c:10:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
string a;
int ac=0;
int b,c;
int e,f;
  cin >> b >> c >> a;
  for (int i=0; i<c; i++){
    cin >> e >> f;
    for (int g=e; g<f; g++){
    if(a.at(g)=='A'){
      g++;
      if(a.at(g)=='c'&&g<f){
      ac++;
      }
    }
    cout << ac << endl;
    ac=0;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
string a;
int ac=0;
int b,c;
int e,f;
  cin >> b >> c >> a;
  for (int i=0; i<c; i++){
    cin >> e >> f;
    d='A';
    for (int g=e; g<f; g++){
    if(a.at(g)=='A'){
      g++;
      if(a.at(g)=='c'){
      ac++;
      }
    }
    cout << ac << endl;
    ac=0;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'd' was not declared in this scope
   12 |     d='A';
      |     ^
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
  int N,Q;
  cin>>N>>Q;
  char S[N+1];
  for(int i=1; i<=N; ++i) cin>>S[i];
  int L[Q+1],R[Q+1];
  for(int i=1; i<=Q; ++i) cin>>L[i]>>R[i];
  
  int dp[N][N+1];
  for(int i=0; i<N; ++i){
    for(int j=i+1; j<=N; ++j){
      dp[i][j]==0;
    }
  }
  if(S[1]=='A' && S[2]=='C') dp[1][2]=1;
  for(int i=1; i<N; ++i){
    for(int j=i+1; j<=N; ++j){
      if(S[j]=='A' && S[j+1]=='C') dp[i][j+1]=dp[i][j]+1;
      else dp[i][j+1]=dp[i][j];
    }
    if(S[i-1]=='A' && S[i]=='C') dp[i][i+1]=dp[i-1][i+1]-1;
    else dp[i+1][j]=dp[i][j];
  }
  for(int i=1; i<=Q; ++i){
    cout<<dp[L[i]][R[i]]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: 'j' was not declared in this scope
   28 |     else dp[i+1][j]=dp[i][j];
      |                  ^
Language: C

#include<stdio.h>
char s[200000]
int l[200000],r[200000],answer[200000];
int main()
{
    int i=0,num=0,max=0,n=0,q=0;
   
   scanf("%d%d",&n,&q);
   scanf("%s"s);
   for(i=0; i<q; i++)
   {
       answer[i]=0;
       scanf("%d%d",&l[i],&r[i]);
   }

   for(i=0; i<q; i++)
   {
      for(j=l[i]; j<r[i]-1; j++)
      {
          if(s[j]=='C' && s[j-1]=='A')
          {
              answer[i]+=1;
          }
      }
   }

   for(i=0; i<q; i++)
   {
       if(i != 0)
       {
           printf("\n");
       }
       printf("%d",answer[i]);
   }
    return 0;
}

Compiler output:
main.c:2:15: error: expected ';' before 'int'
    2 | char s[200000]
      |               ^
      |               ;
    3 | int l[200000],r[200000],answer[200000];
      | ~~~            
main.c: In function 'main':
main.c:9:14: error: expected ')' before 's'
    9 |    scanf("%s"s);
      |         ~    ^
      |              )
main.c:18:11: error: 'j' undeclared (first use in this function)
   18 |       for(j=l[i]; j<r[i]-1; j++)
      |           ^
main.c:18:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:14: error: 's' undeclared (first use in this function)
   20 |           if(s[j]=='C' && s[j-1]=='A')
      |              ^
Language: Java

import java.util.Scanner;

public class TypeC2 {
	
	public static void Main(String[] args) {
		Scanner s = new Scanner(System.in);
		
		s.nextInt();
		int q = s.nextInt();
		String inS = s.next();
		char[] chars = inS.toCharArray();
		char[] target = "AC".toCharArray();
		
		int start;
		int end;
		int count;
		int i,j;
		
		for(i=0; i<q ;i++) {
			start = s.nextInt();
			end = s.nextInt();
			count = 0;
			for(j = start -1 ; j < end - 1 ; j ++) {
				if(chars[j] == target[0] && chars[j+1] == target[1]) {
					count++;
					j++;
				}
			}
			System.out.println(count);
			
		}
		
	}

}

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

#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
#include <algorithm>
using namespace std;

int main()
{
    char s[100000];
    int i,a,b,n,m,k;
    while(scanf("%d%d",&a,&b)==2)
    {
        getchar();

        gets(s);

        for(i=0;i<b;i++)
        {
            scanf("%d%d",&n,&m);
            k=0;
            for(int j=n-1;j<m-1;j++)
            {
                if(s[j]=='A'&&s[j+1]=='C')
                    k++;
            }
            printf("%d\n",k);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

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

int count(string s,int l,int r){
 int a = 0;
 for (int i = l-1 ; i < r - 1 ; i++){ 
 if (s.at(i) == 'A'){
 if (s.at(i+1) == 'C'){
 a = a+1
}
}
}
 return a;
}


int main() {
  string s;
  int n, q;
  cin >> n >> q;
  cin >> s;

 for (int i = 0 ; i < q ;i++){
 cin >> l >> r;
 cout >> count(s,l,r) >>endl;
}

}


Compiler output:
a.cc: In function 'int count(std::string, int, int)':
a.cc:9:9: error: expected ';' before '}' token
    9 |  a = a+1
      |         ^
      |         ;
   10 | }
      | ~        
a.cc: In function 'int main()':
a.cc:24:9: error: 'l' was not declared in this scope
   24 |  cin >> l >> r;
      |         ^
a.cc:24:14: error: 'r' was not declared in this scope
   24 |  cin >> l >> r;
      |              ^
Language: C++

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

int count(string s,int l,int r){
 int a = 0;
 for (int i = l-1 ; i < r - 1 ; i++){ 
 if (s.at(i) == 'A'){
 if (s.at(i+1) == 'C'){
 a = a+1
}
}
}
 return a;
}


int main() {
  string s;
  int n, q, c;
  a=0;
  c=0;
  cin >> n >> q;
  cin >> s;

 for (int i = 0 ; i < q ;i++){
 cin >> l >> r;
 cout >> count(s,l,r) >>endl;
}

}

Compiler output:
a.cc: In function 'int count(std::string, int, int)':
a.cc:9:9: error: expected ';' before '}' token
    9 |  a = a+1
      |         ^
      |         ;
   10 | }
      | ~        
a.cc: In function 'int main()':
a.cc:20:3: error: 'a' was not declared in this scope
   20 |   a=0;
      |   ^
a.cc:26:9: error: 'l' was not declared in this scope
   26 |  cin >> l >> r;
      |         ^
a.cc:26:14: error: 'r' was not declared in this scope
   26 |  cin >> l >> r;
      |              ^
Language: C++

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

int main() {
	int N, Q;
	string s;
	int l, r;
	cin >> N >> Q >> s;
	if (s.find('A', 0) == -1 || s.find('C', 0) == -1) {
		for (int i = 0;i < Q;++i) {
			cin >> l >> r;
			cout << 0 << endl;
			return 0;
		}
	for (int i = 0;i < Q;++i) {
		int count = 0;
		cin >> l>> r;
		for (int j = l - 1;j < r - 1;++j) {
			
			if (s[j] == 'A') {
				if (s[j + 1] == 'C')++count;
			}
		}cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++



#あらかじめ計算しておいて...
datas = gets.split(" ").map{|n|n.to_i}
n = datas[0]
q = datas[1]

answer_nums = []
raw = gets
questions = []
q.times do
  questions << gets.split(" ").map{|n|n.to_i}
end
raw.chars.length.times do|index|
  if index == (raw.length-1)
    next
  end
  if raw[index] == "A" && raw[index+1] == "C"
    answer_nums << index
  end
end
#この時点でindexにはACのAが全部ある
q.times do|ss|
  todayq = questions[ss]
  putnum = 0
  #このうちtodayq[0]-1からtodayq[1]までの要素を数える
  answer_nums.each {|po|
  if po < (todayq[0]-1)
    next
  end
  if (todayq[0]-1) <= po && (todayq[1]-2 >= po)
    putnum += 1
  end
  if (todayq[1]-2 < po)
    break
  end
  }
  puts putnum.to_s
end

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #\U00003042\U00003089\U0000304b\U00003058\U00003081\U00008a08\U00007b97\U00003057\U00003066\U0000304a\U00003044\U00003066
    3 | #あらかじめ計算しておいて...
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:22:2: error: invalid preprocessing directive #\U00003053\U0000306e\U00006642\U000070b9\U00003067index\U0000306b\U0000306fAC\U0000306eA\U0000304c\U00005168\U000090e8\U00003042\U0000308b
   22 | #この時点でindexにはACのAが全部ある
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:26:4: error: invalid preprocessing directive #\U00003053\U0000306e\U00003046\U00003061todayq
   26 |   #このうちtodayq[0]-1からtodayq[1]までの要素を数える
      |    ^~~~~~~~~~~~~~
a.cc:4:1: error: 'datas' does not name a type
    4 | datas = gets.split(" ").map{|n|n.to_i}
      | ^~~~~
a.cc:5:1: error: 'n' does not name a type
    5 | n = datas[0]
      | ^
a.cc:13:1: error: 'end' does not name a type
   13 | end
      | ^~~
a.cc:38:3: error: 'puts' does not name a type
   38 |   puts putnum.to_s
      |   ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
#include <utility>
#include<map>
#include<functional>
#include<climits>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int edgenum[100000];
vector<pair<int, int>> edge;
int main() {
	int n, q,sum[100001];
	fill(sum, sum + 100001, 0);
	string s;
	cin >> n >> q>>s;
	for (int i = 2; i <= n; i++) {
		if (s[i - 2] == 'A'&&s[i - 1] == 'C')sum[i]++;
		sum[i] += sum[i - 1];
	}
	int ans[100000];
	for (int i = 0; i < q; i++) {
		int l, r;
		cin >> l >> r;
	}
	for (int i = 0; i < q; i++) {
		cout << sum[r] - sum[l - 1] << endl;

	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: 'r' was not declared in this scope
   36 |                 cout << sum[r] - sum[l - 1] << endl;
      |                             ^
a.cc:36:38: error: 'l' was not declared in this scope
   36 |                 cout << sum[r] - sum[l - 1] << endl;
      |                                      ^
Language: Java

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), q = sc.nextInt();
		String s = sc.next();
		int ac[] = new int[n];
		String tmp = "AC", tmp2 = "";
		for (int i = 0; i < n - 1; ++i) {
			ac[i + 1] = ac[i];
			tmp2 = s.substring(i,  i + 2);
			if (tmp2.equals(tmp)) 
				ac[i + 1] = ac[i] + 1;
		}
		for (int i = 0; i < q; ++i) {
			int l = sc.nextInt(), r = sc.nextInt();
			int ans = ac[r - 1] - ac[l - 1];
			System.out.println(ans);
		}
		sc.close();

	}

}


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

#include <bits/stdc++.h>

using namespace std;
int main()
{
   int n,q,l,r;
   cin>>n>>q;
   char s[100001];
   scanf("%s",s);
   for(int i=0;i<n;i++)
     {
         cin>>l>>r;
         int count=0;
         for(int j=l-1;j<r;j++)
         {
             if(s[j]=='A'&&s[j+1]=='C'&&j+1<r)
                count++;
         }
         cout<<count<<endl;

     }
     return 0;

}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

Loading subst-jis...done
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int Q = sc.nextInt();
        String s = sc.next();
        int[] a = new int[N];
        char pre = s.charAt(0);
        for(int i = 1; i<N; i++) {
            if(pre=='A' && s.charAt(i)=='C') a[i] = a[i-1] + 1;
            else a[i] = a[i-1];
            pre	= s.charAt(i);
        }
        for(int i = 0; i<Q; i++) {
            int start = sc.nextInt();
            int end = sc.nextInt();
            System.out.println(a[end-1]-a[start-1]);
        }
    }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
Loading subst-jis...done
^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<queue>
#include<map>
#include<iomanip>
using namespace std;

int main(void){
 int N,Q,l,r;
 int  cnt[200000];
 char S[200000];

 cin>>N>>Q;
 cin>>S;

 for(int i=0; i<200000; i++)cnt[i]=0;

 for(int i=1; i<200000; i++){
  if(S[i-1]=='A' && S[i]=='C')cnt[i]=cnt[i-1]+1;
  else cnt[i]=cnt[i-1];
 }
 
 for(int i=0; i<Q; i++){
  cin>>l>>r;
  cout<<cnt[r-1]-cnt[l-1]<<endl;
 }

 return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:33:11: error: expected '}' at end of input
   33 |  return 0;
      |           ^
a.cc:13:15: note: to match this '{'
   13 | int main(void){
      |               ^
Language: C++

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

int main()
{
    char input_str[10000+1];
    char ac_str[2+1] = {"AC"};
    int i = 0;
    int j = 0;
    int ac_point = 0;
    int str_len = 0;

    int st_point = 0;
    int ed_point = 0;

    int same_count = 0;

    // 入力
    scanf("%d %d", &str_len, &q_len);
    scanf("%s", input_str);

    // 問題数分ループ
    for( i = 0; i < q_len; i++ ) {
        same_count = 0;
        scanf("%d %d", &st_point, &ed_point);

        // 文字数分ループ
        for( j = st_point-1; j < ed_point; j++ ) {

            if( input_str[j] == ac_str[ac_point] ) {
                ac_point++;
            }
            else {
                ac_point = 0;
            }

            // 2文字目も一致していれば一致数カウントアップ
            if( ac_point == 2 ) {
                same_count++;
                ac_point = 0;
            }
        }

        // 値出力
        printf("%d\n", same_count);
    }


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:31: error: 'q_len' was not declared in this scope; did you mean 'str_len'?
   19 |     scanf("%d %d", &str_len, &q_len);
      |                               ^~~~~
      |                               str_len
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main () {
  int N, Q;
  cin >> N >> Q;
  string S;
  cin >> S;
  int key[100001];
  int ju = 0;
  for (int i = 0; i < N - 1; i ++) {
    if (S[i] == 'A' && S[i + 1] == 'C') {
      key[j] = i;
      j ++;
    }
  }
  for (int i = 0; i < Q; i ++) {
    int l, r;
    cin >> l >> r;
    int l_ = 0;
    int ma = j - 1;
    while(l_ != ma) {
      int mu = (ma + l_) / 2;
      if (key[mu] < l) l_ = mu + 1;
      else ma = mu;
    }
    int r_ = j - 1;
    int mi = 0;
    while(r_ != mi) {
      int mu = (mi + r_) / 2;
      if (key[mu] + 1 > r) r_ = mu - 1;
      else mi = mu;
    }
    int ans = r_ - l_ + 1;
    cout << ans << endl;
  }
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'j' was not declared in this scope
   13 |       key[j] = i;
      |           ^
a.cc:21:14: error: 'j' was not declared in this scope
   21 |     int ma = j - 1;
      |              ^
Language: C++

process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
	input: process.stdin,
	output: process.stdout
});

reader.on('line', (line) => {
	lines.push(line);
});

reader.on('close', () => {
  var NQ = lines[0].split(" ");
  var N = +NQ[0];
  var Q = +NQ[1];
  var S = lines[1];
  var l = new Array(Q);
  var r = new Array(Q);
  for(var i = 0; i<Q; i++){
    var lr = lines[i+2].split(" ");
    l[i] = +lr[0];
    r[i] = +lr[1];
  }
  
  for(var i = 0; i<Q; i++){
    var ans = S.slice(l[i]-1,r[i]).match(/AC/g);
    console.log(ans?ans.length:0);
  }
});

Compiler output:
a.cc:2:27: warning: multi-character character constant [-Wmultichar]
    2 | process.stdin.setEncoding('utf8');
      |                           ^~~~~~
a.cc:5:22: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    5 | var reader = require('readline').createInterface({
      |                      ^~~~~~~~~~
a.cc:10:11: warning: multi-character character constant [-Wmultichar]
   10 | reader.on('line', (line) => {
      |           ^~~~~~
a.cc:14:11: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   14 | reader.on('close', () => {
      |           ^~~~~~~
a.cc:1:1: error: 'process' does not name a type
    1 | process.stdin.resume();
      | ^~~~~~~
a.cc:2:1: error: 'process' does not name a type
    2 | process.stdin.setEncoding('utf8');
      | ^~~~~~~
a.cc:4:1: error: 'var' does not name a type
    4 | var lines = [];
      | ^~~
a.cc:5:1: error: 'var' does not name a type
    5 | var reader = require('readline').createInterface({
      | ^~~
a.cc:8:2: error: expected unqualified-id before ')' token
    8 | });
      |  ^
a.cc:10:1: error: 'reader' does not name a type
   10 | reader.on('line', (line) => {
      | ^~~~~~
a.cc:12:2: error: expected unqualified-id before ')' token
   12 | });
      |  ^
a.cc:14:1: error: 'reader' does not name a type
   14 | reader.on('close', () => {
      | ^~~~~~
a.cc:31:2: error: expected unqualified-id before ')' token
   31 | });
      |  ^
Language: C++

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

int main(void) {
    int n, q;
    string s;
    scanf("%d%d", &n, &q);
    cin >> s;

    vector<int> count(n);
    for (int i = 0; i < n - 1; i++) {
        count[i + 1] = count[i];
        count[i + 1] += strcmp(s.substr(i, 2).c_str(), "AC") == 0;
    }

    for (int i = 0; i < q; i++) {
        int l, r;
        scanf("%d%d", &l, &r);
        l--, r--;
        printf("%d\n", count[r] - count[l]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'strcmp' was not declared in this scope
   15 |         count[i + 1] += strcmp(s.substr(i, 2).c_str(), "AC") == 0;
      |                         ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
//map<key,value>

int main(){
  int n,q;
  string s;
  cin >> n >> q;
  cin >> s;
  vector<int>l(q);
  vector<int>r(q);
  for(int i=0;i<q;i++)cin >> l[i] >> r[i];

  for(int i=0;i<q;i++){
    int c=0;
    for(int j=l[i]-1;j<r[i]-1S;j++){
      if(j<n-1){
        if(s[j]=='A' && s[j+1]=='C')c++;
      }
    }
    cout << c << "\n";
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: unable to find numeric literal operator 'operator""S'
   17 |     for(int j=l[i]-1;j<r[i]-1S;j++){
      |                             ^~
Language: C++

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

struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

signed main() {
	string S;
	long long n,q;

	cin >> n >> q;
	cin >> S;

	for (int i = 0; i < q; i++ ) {
		long long l, r;

		cin >> l >> r;

		long long c;

		for (int m = l - 1; m < r; m++ ) {
			if (S[m]=='A' &  m+1 != r & S[m]=='T') {
				c++;
				m++;
			}
		}
		cout << c << endl;
	}

	

	return 0;
}
#include "bits/stdc++.h"
using namespace std;

struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

signed main() {
	string S;
	long long n,q;

	cin >> n >> q;
	cin >> S;

	for (int i = 0; i < q; i++ ) {
		long long l, r;

		cin >> l >> r;

		long long c;

		for (int m = l - 1; m < r; m++ ) {
			if (S[m]=='A' &  m+1 != r & S[m]=='T') {
				c++;
				m++;
			}
		}
		cout << c << endl;
	}

	

	return 0;
}


Compiler output:
a.cc:36:8: error: redefinition of 'struct Fast'
   36 | struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;
      |        ^~~~
a.cc:4:8: note: previous definition of 'struct Fast'
    4 | struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;
      |        ^~~~
a.cc:36:74: error: conflicting declaration 'int fast'
   36 | struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;
      |                                                                          ^~~~
a.cc:4:74: note: previous declaration as 'Fast fast'
    4 | struct Fast { Fast() { std::cin.tie(0); ios::sync_with_stdio(false); } } fast;
      |                                                                          ^~~~
a.cc:38:8: error: redefinition of 'int main()'
   38 | signed main() {
      |        ^~~~
a.cc:6:8: note: 'int main()' previously defined here
    6 | signed main() {
      |        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  int n,m;
  cin>>n>>m;
  char a[n];
  int d[n+1];
  d[0]=d[1]=0;
  for(int i=1;i<=n;i++){
    cin>>c[i-1];
    if(i!=1){
      int j=0;
      if(c[i-2]=='A'&&c[i-1]=='C'){
        j++;
      }
      d[i]=d[i-1]+j;
    }
  }
  for(int i=0;i<m;i++){
    int r,s;
    cin>>r>>s;
    cout<<d[s]-d[r-1]<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'c' was not declared in this scope
   13 |     cin>>c[i-1];
      |          ^
Language: C++

#include <iostream>
using namespace std;

const int MOD = 1000000007;

int main() {
  int n;
  cin >> n;
  int dp[n + 1][4][4][4] = {};
  dp[0][0][0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int x = 0; x < 4; ++x) {
      for (int y = 0; y < 4; ++y) {
        for (int z = 0; z < 4; ++z) {
          if (dp[i][x][y][z] == 0) {
            continue;
          }
          if (x == 2) {
            // xAG or AxG
            if (y == 1 || z == 1) {
              for (int j = 0; j < 3; ++j) {
                dp[i + 1][j][x][y] += dp[i][x][y][z];
              }
            } else {
              for (int j = 0; j < 4; ++j) {
                dp[i + 1][j][x][y] += dp[i][x][y][z];
              }
            }
          } else if (x == 3 && y == 1) {
            // xAC
            for (int j = 0; j < 4; ++j) {
              if (j == 2) {
                continue;
              }
              dp[i + 1][j][x][y] += dp[i][x][y][z];
            }
          } else if (x == 1 && y == 2) {
            // xGA
            for (int j = 0; j < 3; ++j) {
              dp[i + 1][j][x][y] += dp[i][x][y][z];
            }
          } else if (y == 2 && z == 1) {
            // AGx
            for (int j = 0; j < 3; ++j) {
              dp[i + 1][j][x][y] += dp[i][x][y][z];
            }
          } else {
            for (int j = 0; j < 4; ++j) {
              dp[i + 1][j][x][y] += dp[i][x][y][z];
            }
          }
          dp[i + 1][j][x][y] %= MOD;
        }
      }
    }
  }
  int result = 0;
  for (int i = 0; i < 4; ++i) {
    for (int j = 0; j < 4; ++j) {
      for (int k = 0; k < 4; ++k) {
        result = (result + dp[n][i][j][k]) % MOD;
      }
    }
  }
  cout << result;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:21: error: 'j' was not declared in this scope
   52 |           dp[i + 1][j][x][y] %= MOD;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long long int mod=1e9+7;
long long int dp[105][5][5][5];
int main(){
      int n;
      cin >> n;
      long long int ans=0;
      int nnn=0;
      for(int i=0;i<4;i++){
          for(int j=0;j<4;j++){
              for(int k=0;k<4;k++){
                if(i==0 && j==2 && l==1)nnn++;
                else if(i==0 && j==1 && l==2)nnn++;
                else if(i==2 && j==0 && l==1)nnn++;
                else dp[3][i][j][k]++;
          }
        }
      }
    for(int m=3;m<n;m++){
      for(int i=0;i<4;i++){
          for(int j=0;j<4;j++){
            for(int k=0;k<4;k++){
                for(int l=0;l<4;l++){
                    if(j==0 && k==2 && l==1)nnn++;
                    else if(j==0 && k==1 && l==2)nnn++;
                    else if(j==2 && k==0 && l==1)nnn++;
                    else if(i==0 && k==2 && l==1)nnn++;
                    else if(i==0 && j==2 && l==1)nnn++;                    
                    else dp[m+1][j][k][l]+=dp[m][i][j][k];
                    dp[k+1][j][k][l]%=mod;
                }
            }
        }
        }
    }
      for(int i=0;i<4;i++){
          for(int j=0;j<4;j++){
              for(int k=0;k<4;k++){
              ans+=dp[n][i][j][k];
              ans%=mod;
          }
        }
      }
      cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: 'l' was not declared in this scope
   13 |                 if(i==0 && j==2 && l==1)nnn++;
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  in(n);
  dp[n][4][4];
  rep(i, 4){
    rep(j, 4)
      dp[1][i][j] = 1;
  }
  rep2(i, 2, n){
    rep(j, 4){
      a = 0;
      rep(k, 4)
        a += dp[i - 1][k][j];
      rep(k, 4)
        dp[i][j][k] = a;
    }
    dp[i][1][2] -= dp[i - 1][0][1];
  }
  a = 0;
  rep(i, 4){
    rep(j, 4)
      a += dp[n - 1][i][j];
  }
  out(a);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'dp' was not declared in this scope; did you mean 'dup'?
   20 |   dp[n][4][4];
      |   ^~
      |   dup
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  in(n);
  dp[n][4][4];
  rep(i, 4){
    rep(j, 4)
      dp[1][i][j] = 1;
  }
  rep2(i, 2, n){
    rep(j, 4){
      a = 0;
      rep(k, 4)
        a += dp[i - 1][k][j];
      rep(k, 4)
        dp[i][j][k] = a;
    }
    dp[i][1][2] -= dp[i - 1][0][1];
  }
  a = 0;
  rep(i, 4){
    rep(j, 4)
      a += dp[n - 1][i][j];
  }
  out(a);
  memi p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'dp' was not declared in this scope; did you mean 'dup'?
   20 |   dp[n][4][4];
      |   ^~
      |   dup
a.cc:41:8: error: expected ';' before 'p'
   41 |   memi p;
      |        ^
Language: Java

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int MOD=1e9+7;

ll dp[101][4][4][4];
bool check(int a,int b,int c,int d){
  if(a*100+b*10+c==123||b*100+c*10+d==123)return false;
  swap(a,b);if(a*100+b*10+c==123||b*100+c*10+d==123)return false;swap(a,b);
  swap(b,c);if(a*100+b*10+c==123||b*100+c*10+d==123)return false;swap(b,c);
  swap(c,d);if(a*100+b*10+c==123||b*100+c*10+d==123)return false;swap(c,d);
  return true;
}
ll f(int idx,int a,int b,int c){
  if(~dp[idx][a][b][c])return dp[idx][a][b][c];
  if(idx==3)return 1;
  ll res=0;
  for(int i=0;i<4;i++)if(check(i,a,b,c))res+=f(idx-1,i,a,b);
  return dp[idx][a][b][c]=res%MOD;
}

signed main(){
  memset(dp,-1,sizeof(dp));
  int n;cin>>n;
  ll ans=0;
  for(int i=0;i<64;i++){
    int a=i%4,b=(i/4)%4,c=(i/16)%4;
    if(check(a,b,c,-1))ans+=f(n,a,b,c);
  }
  cout<<ans%MOD<<endl;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
using ll=long long;
^
  (use --enable-preview to enable unnamed classes)
Main.java:3: error: '.class' expected
using ll=long long;
              ^
Main.java:4: error: class, interface, enum, or record expected
const int MOD=1e9+7;
^
Main.java:6: error: class, interface, enum, or record expected
ll dp[101][4][4][4];
^
Main.java:24: error: not a statement
  int n;cin>>n;
           ^
Main.java:30: error: not a statement
  cout<<ans%MOD<<endl;
               ^
8 errors
Language: C++

#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const ll MOD=1e9+7; //定义MOD代替1e9+7
int n;
ll dp[101][4][4][4],ans; 
int main()
{
	cin>>n;
	for(i=0;i<4;i++)
		for(j=0;j<4;j++)
			for(k=0;k<4;k++)
				if((i==0&&j==1&&k==2)||(i==0&&j==2&&k==1)||(i==1&&j==0&&k==2))
					dp[3][i][j][k]=0;
				else
					dp[3][i][j][k]=1;

	for (int len=4;len<=n;++len)
		for (int i=0;i<4;++i)
			for (int j=0;j<4;++j)
				for (int k=0;k<4;++k)
					for (int l=0;l<4;++l)
					{
						if (j==0 && k==2 && l==1) continue;
						if (j==2 && k==0 && l==1) continue;
						if (j==0 && k==1 && l==2) continue;
						if (i==0 && k==2 && l==1) continue;
						if (i==0 && j==2 && l==1) continue;
						dp[len][j][k][l]+=dp[len-1][i][j][k];
						dp[len][j][k][l]%=MOD;
					}
	for (int i=0;i<4;++i)
		for (int j=0;j<4;++j)
			for (int k=0;k<4;++k)
				ans+=dp[n][i][j][k],ans%=MOD;//最终求len=n时的总数，累加
	cout<<ans; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         for(i=0;i<4;i++)
      |             ^
a.cc:11:21: error: 'j' was not declared in this scope
   11 |                 for(j=0;j<4;j++)
      |                     ^
a.cc:12:29: error: 'k' was not declared in this scope
   12 |                         for(k=0;k<4;k++)
      |                             ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

typedef long long ll;
ll MOD = 1000000007;

// a^p
// 2^3 = 2 * 2^2
// 2^2 = 2 * (2^1)
// 2^1 = 2
ll modpow(ll a, ll p, ll mod) {
  if (p == 0) return 1;

  if (p % 2 == 0) {
    ll half = modpow(a, p / 2, mod) % mod;
    return half * half % mod;
  } else {
    return a * modpow(a, p - 1, mod) % mod;
  }
}

// nCa を求める
ll modCombination(ll n, ll a, ll mod) {
  if (n - a < a) {
    return modCombination(n, n - a, mod);
  }

  ll denominator = 1;  // 分母
  ll numerator = 1;    // 分子

  for (ll i = 0; i < a; i++) {
    denominator *= a - i;
    numerator *= n - i;
    denominator %= mod;
    numerator %= mod;
  }

  return numerator * modpow(denominator, mod - 2, mod) % mod;
}

class UnionFind {
 private:
  vector<ll> parents;

 public:
  UnionFind(ll n) : parents(n, -1) {}

  bool issame(ll x, ll y) { return root(x) == root(y); }

  bool merge(ll x, ll y) {
    if (issame(x, y)) return false;

    ll rx = root(x);
    ll ry = root(y);
    if (parents[rx] > parents[ry]) swap(rx, ry);
    // サイズ情報を更新
    parents[rx] += parents[ry];
    // yの親を更新
    parents[ry] = rx;

    return true;
  }

  ll size(ll x) { return -parents[root(x)]; }

 private:
  ll root(ll x) {
    if (parents[x] < 0) return x;
    // 根の親の値に木の(-)サイズの情報を入れる
    return parents[x] = root(parents[x]);
  }
};

int main() {
  ll N;
  cin >> N;

  // AGC
  // ACG
  // GAC
  // A*GC
  // AG*C

  // 0: dummy
  // 1: A
  // 2: G
  // 3: C
  // 4: T
  ll dp[101][5][5][5];

  memset(&dp, 0, sizeof(dp));

  // dp[n][i][j][k]
  // n文字目まで考える
  // k: 直前の文字
  // j: kのひとつ前の文字
  // i: jのひとつ前の文字
  dp[0][0][0][0] = 1;
  for (ll n = 0; n < N; n++) {
    for (ll i = 0; i < 5; i++) {
      for (ll j = 0; j < 5; j++) {
        for (ll k = 0; k < 5; k++) {
          // 文字列 ijk に l を加える
          for (ll l = 1; l < 5; l++) {
            // AGC
            if (j == 1 && k == 2 && l == 3) continue;
            // ACG
            if (j == 1 && k == 3 && l == 2) continue;
            // GAC
            if (j == 2 && k == 1 && l == 3) continue;
            // A*GC
            if (i == 1 && k == 2 && l == 3) continue;
            // AG*C
            if (i == 1 && j == 2 && l == 3) continue;

            dp[n + 1][j][k][l] += dp[n][i][j][k];
            dp[n][j][k][l] %= MOD;
          }
        }
      }
    }
  }

  ll ans = 0;
  for (ll i = 1; i < 5; i++) {
    for (ll j = 1; j < 5; j++) {
      for (ll k = 1; k < 5; k++) {
        ans += dp[N][i][j][k];
      }
    }
  }

  cout << ans % MOD << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:101:3: error: 'memset' was not declared in this scope
  101 |   memset(&dp, 0, sizeof(dp));
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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


int dp[101][4][4][4];

int main() {
  int N; 
  cin>>N;
  
  dp[0][0][0][0]=1;
  
  for (int n = 0; n < N; ++n) {
        for (int i = 0; i < 5; ++i) {
            for (int j = 0; j < 5; ++j) {
                 for (int k = 0; k < 5; ++k) {
                     for (int l = 1; l < 5; ++l) {
                       
                       if (i == 1 && j == 2 && l == 3) continue;
                         if (i == 1 && k == 2 && l == 3) continue;
                         if (j == 1 && k == 2 && l == 3) continue;
                         if (j == 2 && k == 1 && l == 3) continue;
                         if (j == 1 && k == 3 && l == 2) continue;
                       
            dp[N+1][i][j][k] += dp[N][i][j][k];
                         
            dp[N+1][i][j][k] %= 1000000007;
          }
        }
      }
    }
  }
  long long  ans=0;
  
  for(int i=0;i<4;i++){
    for(int j=0;j<4;j++) {
      for(int k=0;k<4;k++) {
        ans+= dp[n][i][j][k];
        ans%= 1000000007;
      }
    }
    
  }
  
  cout<<ans<<endl;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: 'n' was not declared in this scope
   38 |         ans+= dp[n][i][j][k];
      |                  ^