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

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

int main(){
  int n,a,sum=0,ave,ans=0,temp=0;
  vector<int> v;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a;
    v.push_back(a);
    sum+=a;
  }
  ave=sum/n;
  for(int i = 0; i < n; i++){
    ans += (v[i]-ave)*(v[i]-ave);
  }
  for(int i = 0; i < ; i++){
    temp += (v[i]-ave+1)*(v[i]-ave+1);
  }
  if(ans > temp){
      ans = temp;
  }
  temp = 0;
  for(int i = 0; i < ; i++){
    temp += (v[i]-ave-1)*(v[i]-ave-1);
  }

  if(ans > temp)ans = temp;
  for(int i = 0; i < n; i++){
    temp = 0;
    for(int j = 0; j < n; j++){
      temp += (v[i]-v[j])*(v[i]-v[j]);
    }
    if(ans > temp){
      ans = temp;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected primary-expression before ';' token
   19 |   for(int i = 0; i < ; i++){
      |                      ^
a.cc:26:22: error: expected primary-expression before ';' token
   26 |   for(int i = 0; i < ; i++){
      |                      ^
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>

using namespace std;

int main() {

    int N; cin >> N;
    int min, max, ans;
    vector<int> A;

    for (int i = 0; i < N; i++) {
        int tmp; cin >> tmp;
        A.push_back(tmp);
    }

    ans = INT_MAX;
    min = *min_element(A.begin(), A.end());
    max = *max_element(A.begin(), A.end());

    for (int j = min; j <= max; j++) {
        int tmp_ans = 0;
        for (int i = 0; i < N; i++) {
            tmp_ans += ((j - A[i]) * (j - A[i]));
        }
        if(ans > tmp_ans) ans = tmp_ans;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'INT_MAX' was not declared in this scope
   19 |     ans = INT_MAX;
      |           ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <algorithm>
  +++ |+#include <climits>
    5 |
Language: C++

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

int main(){
  int n,a,sum=0,ave,ans=0,temp=0;
  vector<int> v;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a;
    v.push_back(a);
    sum+=a;
  }
  ave=sun/n;
  for(int i = 0; i < n; i++){
    ans += (v[i]-ave)*(v[i]-ave);
  }
  for(int i = 0; i < n; i++){
    temp = 0;
    for(int j = 0; j < n; j++){
      temp += (v[i]-v[j])*(v[i]-v[j]);
    }
    if(ans > temp){
      ans = temp;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'sun' was not declared in this scope; did you mean 'sum'?
   15 |   ave=sun/n;
      |       ^~~
      |       sum
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(void){
    int n;
    int max = 0;
    int min = 1000;
    int cost = 10000000;
    
    cin >> n;
    
    int arrray[n];
    
    for(int i=0;i<n;i++){
        cin >> arrray[i];
        
        if(arrray[i] > max){
            max = arrray[i];
        }
        
        if(arrray[i]　< min ){
            min = arrray[i];
        }
    }
    
    for(int i = min;i<=max;i++){
        int tmpcost=0;
        for(int j=0;j<n;j++){
            if(arrray[j] != i){
                tmpcost += pow((arrray[j] - i),2);
            }
        }
        if(tmpcost < cost){
            cost = tmpcost;
        }
    }
    
    cout << cost << endl;
    
    return 0;
    
}


Compiler output:
a.cc:21:21: error: extended character 　 is not valid in an identifier
   21 |         if(arrray[i]　< min ){
      |                     ^
a.cc: In function 'int main()':
a.cc:21:21: error: expected ')' before '\U00003000'
   21 |         if(arrray[i]　< min ){
      |           ~         ^~
      |                     )
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
int main(void){
    int n;
    int max = 0;
    int min = 1000;
    int cost = 10000000;
    
    cin >> n;
    
    int arrray[n];
    
    for(int i=0;i<n;i++){
        cin >> arrray[i];
        
        if(arrray[i] > max){
            max = arrray[i];
        }
        
        if(arrray[i]　< min ){
            min = arrray[i];
        }
    }
    
    for(int i = min;i<=max;i++){
        int tmpcost=0;
        for(int j=0;j<n;j++){
            if(arrray[j] != i){
                tmpcost += pow((arrray[j] - i),2);
            }
        }
        if(tmpcost < cost){
            cost = tmpcost;
        }
    }
    
    cout << cost << endl;
    
}


Compiler output:
a.cc:21:21: error: extended character 　 is not valid in an identifier
   21 |         if(arrray[i]　< min ){
      |                     ^
a.cc: In function 'int main()':
a.cc:21:21: error: expected ')' before '\U00003000'
   21 |         if(arrray[i]　< min ){
      |           ~         ^~
      |                     )
Language: C++

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

int main(){
  int n,a,sum=0,ave,ans=0;
  vector<int> v;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a;
    v.push_back(a);
    sum+=a;
  }
  ave=sun/n;
  for(int i = 0; i < n; i++){
    ans += (v[i]-ave)*(v[i]-ave);
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'sun' was not declared in this scope; did you mean 'sum'?
   15 |   ave=sun/n;
      |       ^~~
      |       sum
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import static java.lang.Math.round;

public class Math{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int inputCount = sc.nextInt();
		List<Integer> inputList = new ArrayList<Integer>();
		for(int i=0;i<inputCount;i++){
			inputList.add(sc.nextInt());
		}
		
		//平均値を求める
		int sum = 0;
		for(Integer input : inputList){
			sum += input;
		}
		int ave = (int)round((double)sum/(double)inputCount);
		
		//コスト計算
		int cost = 0;
		for(Integer input : inputList){
			cost += (ave - input)*(ave - input);
		}
		sc.close();
		System.out.print(cost);
	}
}


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

#include <iostream>
#include<string>
#include<vector>
using namespace std;
int calCost(vector<int>& nums, int i){
	int ans = 0;
	for (auto& elem : nums){
		ans += (elem - i)*(elem - i);
	}
	return ans;
}
int main()
{
	int N,t,max=-100,min=100,minCost=INT_MAX;
	vector<int> nums;
	cin >> N;
	for (int i = 0; i < N; ++i){
		cin >> t;
		nums.push_back(t);
		if (t>max){ max = t; }
		if (t < min){ min = t; }
	}


	for (int i = min; i <= max; ++i){
		int cost = calCost(nums, i);
		if (cost < minCost){
			minCost = cost;
		}
		else{ break; }
	}
	cout << minCost << endl;
	cin >> t;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:42: error: 'INT_MAX' was not declared in this scope
   14 |         int N,t,max=-100,min=100,minCost=INT_MAX;
      |                                          ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include<vector>
  +++ |+#include <climits>
    4 | using namespace std;
Language: Java

import java.util.Arrays;
import java.util.Scanner;

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

        int n = sc.nextInt();

        int num[] = new int[n];
        int total = 0;
        for (int i = 0; i < n; i++) {
            int m = sc.nextInt();
            num[i] = m;
            total += m;
        }

        float avg = (float)total / (float)n;

        Arrays.sort(num);

        int average;
        if (avg % 1 == 0) {
            average = (int)avg;
        } else {
            average = (int)avg + 1;
        }

        int median =
                n > 2 ? num[(n%2==0 ? n/2 + 1 : n/2)]
                        : (n > 1 ? Math.min(num[0], num[1])
                                    :num[0]);

        int criteria = average;
        if(average < median) {
            criteria = median;
        }
        
        int cost = 0;
        for (int i = 0; i < n; i++) {
            if(num[i] != criteria) {
                cost += Math.pow((num[i] - criteria), 2);
            }
        }

        System.out.println(cost);
    }
}

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

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

public class Math {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int inputCount = sc.nextInt();
		List<Integer> inputList = new ArrayList<Integer>();
		for(int i=0;i<inputCount;i++){
			inputList.add(sc.nextInt());
		}
		
		//平均値を求める
		int sum = 0;
		for(Integer input : inputList){
			sum += input;
		}
		int ave = (int)Math.ceil((double)sum/(double)inputCount);
		
		//コスト計算
		int cost = 0;
		for(Integer input : inputList){
			cost += (ave - input)*(ave - input);
		}
		
		System.out.print(cost);
	}
}

Compiler output:
Main.java:5: error: class Math is public, should be declared in a file named Math.java
public class Math {
       ^
Main.java:21: error: cannot find symbol
		int ave = (int)Math.ceil((double)sum/(double)inputCount);
		                   ^
  symbol:   method ceil(double)
  location: class Math
2 errors
Language: C++

import numpy as np
N = int(raw_input())
a = np.array(map(int, raw_input().split()))
cost = []
for y in xrange(a.min(), a.max() + 1):
    cost.append(np.sum((a - y) ** 2))
print min(cost)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C

#include<stdio.h>
int main(void){
int s[102],a[12];
int i,n,t=0,c=0,g,h,r=0,e=0;
for(i=0,I<n,i++){
scanf("%d",&s[i]);
t+=s[i];
}
g=t/n;
h=t/n;
for(i=0;i<n;i++){
r+=(s[i]-g)*(s[i]-g);
e+=(s[i]-h)*(s[i]-h);
}
if(r>e)printf("%d\n",e);
else printf("%d\n",r);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'I' undeclared (first use in this function)
    5 | for(i=0,I<n,i++){
      |         ^
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:16: error: expected ';' before ')' token
    5 | for(i=0,I<n,i++){
      |                ^
      |                ;
main.c:5:16: error: expected expression before ')' token
Language: C

#include<stdio.h>
int main(void){
int s[12],a[12];
int i,n,t=0,c=0,g,h,r=0,e=0;
for(i=0,I<n,i++){
scanf("%d",&s[i]);
t+=s[i];
}
g=t/n;
h=t/n;
for(i=0;i<n;i++){
r+=(s[i]-g)*(s[i]-g);
e+=(s[i]-h)*(s[i]-h);
}
if(r>e)printf("%d\n",e);
else printf("%d\n",r);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: 'I' undeclared (first use in this function)
    5 | for(i=0,I<n,i++){
      |         ^
main.c:5:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:16: error: expected ';' before ')' token
    5 | for(i=0,I<n,i++){
      |                ^
      |                ;
main.c:5:16: error: expected expression before ')' token
Language: Java

import java.util.*;
import java.lang.Math;
public class Main{
public static void main(String[] args){
Scanner x= new Scanner(System.in);

int c= x.nextInt();
int[] arr = new int[c];
double a =0;
for(int i =0;i<c;i++){
	arr[i]=x.nextInt();
	a += arr[i];
}

int a1 = a/c;
int a2 = a1 +1;


int r1=0;

for(int i =0;i<c;i++){
	r1 += Math.pow(arr[i]-a1 , 2);
}


for(int i =0;i<c;i++){
	r2 += Math.pow(arr[i]-a2 , 2);
}

System.out.prinln(Math.min(r1,r2));



}
}


Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from double to int
int a1 = a/c;
          ^
Main.java:27: error: cannot find symbol
	r2 += Math.pow(arr[i]-a2 , 2);
	^
  symbol:   variable r2
  location: class Main
Main.java:30: error: cannot find symbol
System.out.prinln(Math.min(r1,r2));
                              ^
  symbol:   variable r2
  location: class Main
3 errors
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

int n, ave = 0;
int a[110];

int main() {

	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		ave += a[i];
	}
	ave /= n;

	int d, min = INT_MAX;
	for (int i = ave - 3; i <= ave + 3; ++i) {
		d = 0;
		for (int j = 0; j < n; ++j)
			d += (a[j] - i) * (a[j] - i);

		if (d < min)
			min = d;
	}

	cout << min << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:22: error: 'INT_MAX' was not declared in this scope
   36 |         int d, min = INT_MAX;
      |                      ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include <cstdio>
  +++ |+#include <climits>
   21 |
Language: C++

n = int(raw_input())
a = map(int, raw_input().split())

sum = sum(a)
if(sum >= 0):
    ave = int(float(sum) / n + 0.5)
else:
    ave = int(float(sum) / n - 0.5)   

cost = 0
for item in a:
    cost += pow(abs(item - ave), 2)
    

print cost,

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(raw_input())
      | ^
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int main()
{
	int n;
	int a[103];

	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];

	int ans = INT_MAX;

	for (int i = -100; i < 101; i++) {
		int sum = 0;
		for (int j = 0; j < n; j++) {
			sum += (i - a[j]) * (i - a[j]);
		}
		ans = std::min(ans, sum);
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: 'INT_MAX' was not declared in this scope
   33 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:16:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   15 | #include <functional>
  +++ |+#include <climits>
   16 | using namespace std;
Language: C

#include <iostream>
using namespace std;

int round(double);

int main(){

	int N;
	cin >> N;
	int n;
	int A=0,B=0;

	for(int i=0; i<N; i++){
		cin >> n;
		A += n*n;
		B += n;
	}

	double x = (double)B/N;

//	cout << x << endl;
//	cout << round(x) << endl;

	int modify = round(x);
	
	cout << N*modify*modify - 2* modify * B + A << endl;

	return 0;
}

int round(double x){
	double fraction = x - (int)x;

	if(fraction >= 0.5)
		return (int)x + 1;
	else
		return (int)x;
}	


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

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <ctime>
#include <algorithm>
#include <cstdlib>
#include <utility>
#include <vector>
#include <iostream>
#include <cstring>
#include <set>
#include <map>
#include <string>

namespace fastinput
{
	/** Interface */

	inline int readChar();
	template <class T = int> inline T readInt();
	template <class T> inline void writeInt(T x, char end = 0);
	inline void writeChar(int x);
	inline void writeWord(const char *s);

	/** Read */

	static const int buf_size = 16384;

	inline int getChar() {
		static char buf[buf_size];
		static int len = 0, pos = 0;
		if (pos == len)
			pos = 0, len = fread(buf, 1, buf_size, stdin);
		if (pos == len)
			return -1;
		return buf[pos++];
	}

	inline int readChar() {
		int c = getChar();
		while (c <= 32)
			c = getChar();
		return c;
	}

	template <class T>
	inline T readInt() {
		int s = 1, c = readChar();
		T x = 0;
		if (c == '-')
			s = -1, c = getChar();
		while ('0' <= c && c <= '9')
			x = x * 10 + c - '0', c = getChar();
		return s == 1 ? x : -x;
	}

	/** Write */

	static int write_pos = 0;
	static char write_buf[buf_size];

	inline void writeChar(int x) {
		if (write_pos == buf_size)
			fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
		write_buf[write_pos++] = x;
	}

	template <class T>
	inline void writeInt(T x, char end) {
		if (x < 0)
			writeChar('-'), x = -x;

		char s[24];
		int n = 0;
		while (x || !n)
			s[n++] = '0' + x % 10, x /= 10;
		while (n--)
			writeChar(s[n]);
		if (end)
			writeChar(end);
	}

	inline void writeWord(const char *s) {
		while (*s)
			writeChar(*s++);
	}

	struct Flusher {
		~Flusher() {
			if (write_pos)
				fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
		}
	} flusher;
}

using namespace fastinput;
using namespace std;

int main()
{
	::ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	vector <int> v(n);
	for (int i = 0; i < n; ++i)
		cin >> v[i];
	int res = INT_MAX;
	for (int x = -100; x <= 100; ++x)
	{
		int cur = 0;
		for (int i = 0; i < n; ++i)
		{
			cur += abs(v[i] - x) * abs(v[i] - x);
		}
		res = min(res, cur);
	}
	cout << res << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:106:19: error: 'INT_MAX' was not declared in this scope
  106 |         int res = INT_MAX;
      |                   ^~~~~~~
a.cc:12:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <map>
  +++ |+#include <climits>
   12 | #include <string>
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s; cin >> s;
  int n = s.size();
  for(int i = 0; i < n; i++){
    if(i < n-1 && s[i] == s[i+1]){
      cout << i+1 << " " << i+2 << endl;
      return;
    }else if(i < n-2 && s[i] == s[i+2]){
      cout << i+1 << " " << i+3 << endl;
      return;
    }
  }
  cout << "-1 -1" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |       return;
      |       ^~~~~~
a.cc:12:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   12 |       return;
      |       ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s; cin >> s;
  for(int i = 0; i < s.size(); i++){
    if(i < n-1 && s[i] == s[i+1]){
      cout << i+1 << " " << i+2 << endl;
      return;
    }else if(i < n-2 && s[i] == s[i+2]){
      cout << i+1 << " " << i+3 << endl;
      return;
    }
  }
  cout << "-1 -1" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'n' was not declared in this scope
    6 |     if(i < n-1 && s[i] == s[i+1]){
      |            ^
a.cc:8:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
    8 |       return;
      |       ^~~~~~
a.cc:11:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |       return;
      |       ^~~~~~
Language: C++

# include <bits/stdc++.h>
# define ll long long
# define all(x) x.begin(), x.end()
# define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
# define MOD 1000000007
														
using namespace std;

int main(){
	//fastio;
	vector<vector<int>> a(26);
	char tmp=getchar();
	int n=0;
	while (tmp>='a'&&tmp<='z'){
		a[tmp-'a'].push_back(n++);
		tmp=getchar();
	}

	int x=-1,y=-1;
	bool found=false;
	for (auto poses:a){
		sort(all(poses));
		if (poses.size()<2) continue;
		for (int i=1;i<poses.size();i++){
			int dis=poses[i]-poses[i-1];
			if(dis==1) {
				x=poses[i-1];y=poses[i];
				found=true;
				break;
			}
			else if(dis==2){
					x=poses[i-2],y=poses[i];
					found=true;
					break;
			}
			if (found) break;
	}
	cout<<x<<' '<<y<<'\n';
	return 0;
}
	


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

#include<bits/stdc++.h>

using namespace std;

int arr[1000 * 100 + 1][26];
vector<int > indexes[26];

int main()
{
	string str;
	cin >> str;
	
	int n = str.length();
	
	for(int i = 0; i < n; i++)
	{
		int curr = str[i] - 'a';
		if(i > 0)
		{
			arr[i][curr] += (arr[i-1][curr] + 1);
		}
		else
		{
			arr[i][curr]++;	
		}
		
		for(int k = indexes[curr].size() - 1; k >= 0; --k)
		{	
          	int it = indexes[k];
			int len = i - it + 1;
			int totalChar = arr[i][curr] - arr[it][curr] + 1;
			
			if(totalChar >= len / 2)
			{
				cout << (it + 1) << " " << (i + 1) << endl;
				return 0;
			}
		}
		
		indexes[curr].push_back(i);
	}
	
	cout << "-1 -1" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:35: error: cannot convert 'std::vector<int>' to 'int' in initialization
   29 |                 int it = indexes[k];
      |                          ~~~~~~~~~^
      |                                   |
      |                                   std::vector<int>
Language: C++

const int N = 2e3 + 7, M = N * 3;
int n;
modint f[M][M<<1], ans;
int main() {
	rd(n), rd(P), n *= 3;
	f[0][M] = 1;
	for (int i = 0; i < n; i++)
		for (int j = -i; j <= i; j++) {
			f[i+1][j+1+M] += f[i][j+M];
			f[i+2][j-1+M] += f[i][j+M] * (i + 1);
			f[i+3][j+M] += f[i][j+M] * (i + 1) * (i + 2);
		}
	for (int j = 0; j <= n; j++) ans += f[n][j+M];
	print(ans);
	return 0;
}

Compiler output:
a.cc:3:1: error: 'modint' does not name a type
    3 | modint f[M][M<<1], ans;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'rd' was not declared in this scope
    5 |         rd(n), rd(P), n *= 3;
      |         ^~
a.cc:5:19: error: 'P' was not declared in this scope
    5 |         rd(n), rd(P), n *= 3;
      |                   ^
a.cc:6:9: error: 'f' was not declared in this scope
    6 |         f[0][M] = 1;
      |         ^
a.cc:13:38: error: 'ans' was not declared in this scope
   13 |         for (int j = 0; j <= n; j++) ans += f[n][j+M];
      |                                      ^~~
a.cc:14:15: error: 'ans' was not declared in this scope
   14 |         print(ans);
      |               ^~~
a.cc:14:9: error: 'print' was not declared in this scope; did you mean 'int'?
   14 |         print(ans);
      |         ^~~~~
      |         int
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
typedef pair<int, int> ii;
typedef vector<ii> vii; 
typedef vector<int> vi;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0);
	
	string s;
	cin >> s;
	if(s.length() == 2) {
		if(s[i] == s[i + 1]) cout << i + 1 << " " << i + 2 << endl;
	} else {	
		for(int i = 0; i < s.length() - 2; i++) {
			if(s[i] == s[i + 1] || s[i] == s[i + 2] || s[i + 1] == s[i + 2]) {
				cout << i + 1 << " " << i + 3 << endl;
				return 0;
			}
		}
	}
	
	cout << "-1 -1" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'i' was not declared in this scope
   15 |                 if(s[i] == s[i + 1]) cout << i + 1 << " " << i + 2 << endl;
      |                      ^
Language: C++


#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1001001001;


int main(){
  string s;
  cin>>s;
  int n;
  n=s.size();
  vector<int>v(n);
  //bool check=false;
  ll ans=-1;
  if (n==2){
    if (s[0]==s[1]){
      cout<<0<<" "<<1;
      return 0;
    }else{
      cout<<1-<<" "<<-1;
      return 0;
    }
  }
  for(int i=2;i<n;i++){
    if (s[i]==s[i-1]){
      cout<<i<<" "<<i+1;
      return 0;
    }
    if (s[i]==s[i-2]){
      cout<<i-1<<" "<<i+1;
      return 0;
    }

  }
  cout<<-1<<" "<<-1;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: expected primary-expression before '<<' token
   23 |       cout<<1-<<" "<<-1;
      |               ^~
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <list>
#include <string>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip> // setprecisionを使用するのに必要 cout << fixed << setprecision(15) << p でpを小数点以下15桁表示
using namespace std;
#define REPD(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) REPD(i, 0, n)
typedef long long ll;
#define fin(ans) cout << (ans) << '\n'
/*

*/
int main()
{
    string S;
    cin >> S;
    int l = S.length();
    int st = -1,ed = -1;
    //DPクソもないけどoxoみたいな構造を探してやればいいらしい。そりゃそうだ
    if(l <= 2){
        if(S[i] == S[i+1]){
            cout << "1 2" << endl;
        }else{
            cout << "-1 -1" << endl;
        }
        return 0;
    }
    REP(i,l-2){
        //cout << S[i] << S[i + 1] << S[i + 2] << endl;
        if (S[i] == S[i + 1] || S[i] == S[i + 2] || S[i + 1] == S[i + 2])
        {
            st = i+1;
            ed = i+3;
            break;
        }
    }
    cout << st << " " << ed << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'i' was not declared in this scope
   28 |         if(S[i] == S[i+1]){
      |              ^
Language: C++

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

int main()
{
    char a[100005];
    gets(a);

    int n=strlen(a);

    int p=0;

    for(int i=0; i<n-2; i++)
    {
        if(a[i]==a[i+1] || a[i]==a[i+2] || a[i+1]==a[i+2])
        {
            p=i+1;
            break;
        }
    }
    if(p != 0)
        printf("%d %d\n",p,p+2);
    else
        printf("-1 -1\n");


    return 0;
}


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

#include<stdio.h>

int main(){
	char s[100001] = {'\0'};
	scanf("%s", s);
	int size, i, flag;
	flag = -1;
	int a[26] = {0};
	for(i = 0; s[i+1] != '\0'; i++){
		if(s[i] == s[i+1]) break;
		if(s[i+2] == '\0') flag++;
	};
	for(i = 0; s[i+2] != '\0'; i++){
		if(s[i] == s[i+2]) break;
		if(s[i+3] == '\0') flag++;
	};
	if(flag == 1){
		printf("-1 -1\n")
	}else{
		
	};
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:34: error: expected ';' before '}' token
   18 |                 printf("-1 -1\n")
      |                                  ^
      |                                  ;
   19 |         }else{
      |         ~
Language: C++

//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  string s;cin>>s;
  rep(i,n-1){
    if(s[i]==s[i+1]){
      cout<<i+1<<" "<<i+2<<endl;
      return 0;
    }
  }
  rep(i,n-2){
    if(s[i]==s[i+2]){
      cout<<i+1<<" "<<i+3<<endl;
      return 0;
    }
  }
  cout<<-1<<" "<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'n' was not declared in this scope
   17 |   rep(i,n-1){
      |         ^
a.cc:5:43: note: in definition of macro 'rep'
    5 | #define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
      |                                           ^
a.cc:23:9: error: 'n' was not declared in this scope
   23 |   rep(i,n-2){
      |         ^
a.cc:5:43: note: in definition of macro 'rep'
    5 | #define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
      |                                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    while(t--)
    {
        string s;
        cin>>s;
        int flag = 1;
        for(int i=0;i<s.length()-1;i++)
        {
            if(s[i]==s[i+1])
            {
                cout<<i+1<<" "<<i+2<<endl;
                flag = 0;
                break;
            }
            else if((i<s.length()-2)&&(s[i]==s[i+2]))
            {
                cout<<i+1<<" "<<i+3<<endl;
                flag = 0;
                break;
            }
        }
        if(flag==1)
        {
            cout<<-1<<" "<<-1<<endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 't' was not declared in this scope; did you mean 'tm'?
    5 |     while(t--)
      |           ^
      |           tm
Language: C++

int main(){
    string s;
    cin >> s;
    if (s.size()==2){
        if (s.at(0)==s.at(1)){
            cout << 1 << " " << 2 << endl;
        } else {
            cout << -1 << " " << -1 << endl;
        }
        return 0;
    }
    for (int i=0; i<s.size()-2; i++){
        if (s.at(i)==s.at(i+1) || s.at(i+1)==s.at(i+2) || s.at(i+2)==s.at(i)){
            cout << i+1 << " " << i+3 << endl;
            return 0;
        }
    }
    cout << -1 << " " << -1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'string' was not declared in this scope
    2 |     string s;
      |     ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> s;
      |     ^~~
a.cc:3:12: error: 's' was not declared in this scope
    3 |     cin >> s;
      |            ^
a.cc:6:13: error: 'cout' was not declared in this scope
    6 |             cout << 1 << " " << 2 << endl;
      |             ^~~~
a.cc:6:38: error: 'endl' was not declared in this scope
    6 |             cout << 1 << " " << 2 << endl;
      |                                      ^~~~
a.cc:8:13: error: 'cout' was not declared in this scope
    8 |             cout << -1 << " " << -1 << endl;
      |             ^~~~
a.cc:8:40: error: 'endl' was not declared in this scope
    8 |             cout << -1 << " " << -1 << endl;
      |                                        ^~~~
a.cc:14:13: error: 'cout' was not declared in this scope
   14 |             cout << i+1 << " " << i+3 << endl;
      |             ^~~~
a.cc:14:42: error: 'endl' was not declared in this scope
   14 |             cout << i+1 << " " << i+3 << endl;
      |                                          ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
   18 |     cout << -1 << " " << -1 << endl;
      |     ^~~~
a.cc:18:32: error: 'endl' was not declared in this scope
   18 |     cout << -1 << " " << -1 << endl;
      |                                ^~~~
Language: C++

#include <iostream>

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

    int i;
    for (i = 0; i < s.size() - 2; i++) {
        if (s[i] == s[i + 1] || s[i] == s[i + 2]) {
            break;
        }
    }

    if (i == s.size() - 2) std::cout << -1 << " " << -1;
    else std::cout << i << " " << i + 2;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s;
      |     ^~~~~~
a.cc:5:5: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:17: error: 's' was not declared in this scope
    6 |     std::cin >> s;
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){

  string s; cin >> s;
  
  for(int i = 1; i < s.size(); ++i) {
  	if(s[i] == s[i-1]){
    	cout << i << " " << i+1 << "\n";
      	return 0;
    }
  }
  
  if(s.size() >= 3){
  	for(int i = 2; i < n; ++i){
    	if(s[i] == s[i-2]){
        	cout << i-1 << " " << i+1 << "\n";
      		return 0;
        }
    }
  }
  
  cout << "-1 -1\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'n' was not declared in this scope
   17 |         for(int i = 2; i < n; ++i){
      |                            ^
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String n = scn.next();
		boolean feka = false;
		int nigger1=-1;
		int nigger2=-1;
		for(int i = 0;i<n.length()-2;i++) {
			if(n.charAt(i)==n.charAt(i+2)) {
				feka = true;
				nigger1=i+1;
				nigger2=i+3;
				break;
			}
			if(n.charAt(i)==n.charAt(i+1)) {
				feka = true;
				nigger1=i+1;
				nigger2=i+2;
				break;
			}
		}
		if(feka) {
			System.out.println(nigger1+" "+nigger2);
		}else System.out.println(nigger1+" "+nigger2);
		scn.close();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scn = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scn = 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;
    cin >> s;
    int n = s.length();
    

    for(int i=0;i<n-3;i++){
        if(s[i]==s[i+1]){
            if(s[i]==s[i+3]){
                cout << i+1 << " " << i+4 << endl;
                return 0;
            }
            else if(s[i]==s[i+2]){
                cout << i+1 << " " << i+4 << endl;
                return 0;
            }
        }
    }

    if(n == 2 && s[0] == s[1]){
        cout << 1 << " " << 2 << endl;
        return 0;
    }
    if(n==3 && s[0]== s[1] || s[1] == s[2]){
        cout << 1 << " " << 3 << endl;
        return 0;
    }

    cout << "-1 -1" << endl;
}

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

int main(){
    string s;
    cin >> s;
    int n = s.length();
    if(s[n-1]==s[n]){
        cout << n-1 << " " << n << endl;
        return 0;
    }
    for(int i=0;i<n-2;i++){
        if(s[i]==s[i+1]){
            cout << i+1 << " " << i+2 << endl;
            return 0;
        }
    }
    cout << "-1 -1" << endl;
}


Compiler output:
a.cc:38:5: error: redefinition of 'int main()'
   38 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int idx[27], pre[27];
int main() {
  string s;
  cin>>s;
  int n =s.size();
  vector<int> ans={-1, -1};
  for (int i = 0; i < 26; ++i) {
    int minv1 = 0;
    int minv2 = INT_MAX;
    int idx1= 0;
    int idx2=0;
    int sum=0;
    int tmp=2*0-1;
    if (s[0] == 'a' + i) {
      tmp=2 * 1-1;
      sum++;
    }
    // if (tmp < minv1) {
    //   minv2 = minv1;
    //   idx2=idx1;
    //   minv1 = tmp;
    //   idx1 = 1;
    // } else if (tmp >= minv1 && tmp < minv2) {
    //   minv2 = tmp;
    //   idx2 = 1;
    // }
    for (int j = 2; j <= n; ++j) {
      if (s[j-1] == 'a' + i) {
        sum++;
      }
      if (2 * sum - j > minv1 && j-idx1 >= 2) {
        ans[0] = idx1+1;
        ans[1] = j;
        break;
      } else if (2 * sum - j > minv2 && j - idx2 >= 2) {
        ans[0] = idx2+1;
        ans[1] = j;
        break;
      }
      if (tmp < minv1) {
        minv2 = minv1;
        idx2=idx1;
        minv1 = tmp;
        idx1 = j-1;
      } else if (tmp >= minv1 && tmp < minv2) {
        minv2 = tmp;
        idx2 = j-1;
      }
      tmp = 2 *sum-j;
    }
    if (ans[0] >= 0) break; //{cout<<i<<endl; break;}
  }
  cout<<ans[0]<<" "<<ans[1]<<endl;
  // for (int i= 0; i < 26; ++i) {
  // 	idx[i] = 0;
  //   pre[i] = 0;
  //   int tmp = 0;
  //   int sum=0;
  //   if (s[0] == 'a' + i) {
  //     tmp = 2 * 1 - 1;
  //     sum++;
  //   } else {
  //     tmp = 2 * 0 - 1;
  //   }
  //   for (int j = 2; j <= n; ++j) {
  //     if (s[j-1] == 'a' + i) {
  //       sum++;
  //     	if (2*sum - j > pre[i]) {
  //         ans[1] = j;
  //         ans[0] = idx[i]+1;
  //         break;
  //       }
  //       if (tmp < pre[i]) {
  //         pre[i] = tmp;
  //         idx[i] = j-1;
  //       }
  //       tmp = 2*sum - i;
  //     }
  //   }
  //   if (ans[0] >= 0) break;
  // }
  // if (ans[0] < 0) cout<<"-1 -1"<<endl;
  // else cout<<ans[0]<<" "<<ans[1]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'INT_MAX' was not declared in this scope
   15 |     int minv2 = INT_MAX;
      |                 ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <algorithm>
  +++ |+#include <climits>
    6 | using namespace std;
Language: C++


import java.io.BufferedReader;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws java.lang.Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		Solver s = new Solver();

		System.out.print(s.solve(br.readLine()));
	}

}

class Solver {

	String solve(String s) {
		for (int length = 2; length <= 3; length++) {
			for (int i = 0; i < s.length() + 1 - length; i++) {
				if (s.charAt(i) == s.charAt(i + length - 1)) {
					return "" + i + " " + (i + length - 1);
				}
			}

		}
		return "-1 -1";
	}

}

Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args) throws java.lang.Exception {
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args) throws java.lang.Exception {
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args) throws java.lang.Exception {
      |                                          ^~~~
a.cc:6:46: error: expected ';' at end of member declaration
    6 |         public static void main(String[] args) throws java.lang.Exception {
      |                                              ^
      |                                               ;
a.cc:6:48: error: 'throws' does not name a type
    6 |         public static void main(String[] args) throws java.lang.Exception {
      |                                                ^~~~~~
a.cc:14:2: error: expected ';' after class definition
   14 | }
      |  ^
      |  ;
a.cc:18:9: error: 'String' does not name a type
   18 |         String solve(String s) {
      |         ^~~~~~
a.cc:30:2: error: expected ';' after class definition
   30 | }
      |  ^
      |  ;
Language: C++

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

int beki(int a,int b){
	int ans=1;
	for(int i=0;i<b;i++){
		ans=ans*a;
	}
	return ans;
}
int main(){
string a;
cin>>a;
int t=a.length();
for(int i-0;i<t-2;i++){
if(a[i]==a[i+1]){cout<<i<<" "<<i+1<<endl;return 0;}
if(a[i]==a[i+2]){cout<<i<<" "<<i+2<<endl;return 0;}
}
if(a[t-2]==a[t-1]){cout<<t-2<<" "<<t-1<<endl;return 0;}
cout<<-1<<" "<<-1<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected ';' before '-' token
   16 | for(int i-0;i<t-2;i++){
      |          ^
      |          ;
a.cc:16:18: error: expected ')' before ';' token
   16 | for(int i-0;i<t-2;i++){
      |    ~             ^
      |                  )
a.cc:16:19: error: 'i' was not declared in this scope
   16 | for(int i-0;i<t-2;i++){
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    string s;
    cin>>s;
    int len=s.length();
    int index=-1;
    for(int i=0;i<len-1;i++){
        if(s[i]==s[i+1]){
            index=i;
            break;
        }
    }
    if(index!=-1)
    cout<<index+1<<" "<<index+2;
    else{
        for(int i=1;i<len-1;i++){
            if(s[i-1]==s[i] && s[i]==s[i+1]){
                index=i;
                break;
            }
        }
        if(index==-1)cout<<"-1 -1";
        else cout<<i<<" "<<i+2;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'i' was not declared in this scope
   25 |         else cout<<i<<" "<<i+2;
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    string s;
    cin>>s;
    int len=s.length();
    int index=-1;
    for(int i=0;i<len-1;i++){
        if(s[i]==s[i+1]){
            index=i;
            break;
        }
    }
    if(index==-1)cout<<"-1 -1";
    else cout<<i+1<<" "<<i+2;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: 'i' was not declared in this scope
   16 |     else cout<<i+1<<" "<<i+2;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long m=1e9+7;
long long fact[1000001],inv[1000001];

long long modRecursive(long long a,long long b,long long c)
{
	if(b == 0) return 1;
	if(b%2 ==0) return modRecursive((a*a)%c,b/2,c);
	else return ((a%c)*(modRecursive((a*a)%c,b/2,c)))%c;
}

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

    for(int i = 0; i + 1 < S.size(); i++)
    {
        if(S[i] == S[i + 1])
        {
            cout << i + 1 << " " << i + 2;
            return 0;
        }

        if(i + 2 < S.size() && S[i] == S[i + 2])
        {
            cout << i + 1 << " " << i + 3;
            return 0;
        }
    }

    cout << "-1 -1";
    return 0;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 |     int main()
      |             ^~
a.cc:15:13: note: remove parentheses to default-initialize a variable
   15 |     int main()
      |             ^~
      |             --
a.cc:15:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:1: error: a function-definition is not allowed here before '{' token
   16 | {
      | ^
Language: C++

 #include <iostream>
 #include <algorithm>
 #include <cstring>
 #include <cstdio>
 #include <vector>
 #include <cstdlib>
 #include <iomanip>
 #include <cmath>
 #include <ctime>
 #include <map>
 #include <set>
 #include <queue>
 #include <stack>
 using namespace std;
 #define lowbit(x) (x&(-x))
 #define max(x,y) (x>y?x:y)
 #define min(x,y) (x<y?x:y)
 #define MAX 100000000000000000
 #define MOD 1000000007
 #define pi acos(-1.0)
 #define ei exp(1)
 #define PI 3.141592653589793238462
 #define INF 0x3f3f3f3f3f
 #define mem(a) (memset(a,0,sizeof(a)))
 typedef long long ll;
 ll gcd(ll a,ll b){
     return b?gcd(b,a%b):a;
 }
 bool cmp(int x,int y)
 {
     return x>y;
 }
 ;
 ;
 int main()
 {
     std::ios::sync_with_stdio(false);
     cin.tie();
     ;
     string s;
     cin>>s;
     ;i<s.size()-;i++){
         ]){
             cout<<i+<<<<endl;
             flag=;
             break;
         }
         &&s[i]==s[i+]){
             cout<<i+<<<<endl;
             flag=;
             break;
         }
     }
     if(!flag)
     cout<<-<<<<endl;
     ;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:42:7: error: 'i' was not declared in this scope
   42 |      ;i<s.size()-;i++){
      |       ^
a.cc:42:18: error: expected primary-expression before ';' token
   42 |      ;i<s.size()-;i++){
      |                  ^
a.cc:54:10: error: 'flag' was not declared in this scope
   54 |      if(!flag)
      |          ^~~~
a.cc:55:13: error: expected primary-expression before '<<' token
   55 |      cout<<-<<<<endl;
      |             ^~
a.cc:55:15: error: expected primary-expression before '<<' token
   55 |      cout<<-<<<<endl;
      |               ^~
Language: C++

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

int cnt[50];
int pos[50][100002];
char str[100002];

int main(){
	
	// Init
	for(int i=0;i<50;i++){cnt[i]=0;}
	
	// Input
	cin>>str;
	for(int i=0;i<strlen(str);i++){
		pos[str[i]-'a'][cnt[str[i]-'a']++]=i;
	}

	// Solve
	for(int i='a';i<='z';i++){
		int lk=i-'a';
		for(int j=0;j+1<cnt[lk];j++){
			int len = pos[lk][j+1] - pos[lk][j]+1;
				if(len/2 < 2){
					cout<<pos[lk][j]+1<<" "<<pos[lk][j+1]+1<<endl;
					return(0);
				}
				else break;
			}
		}
	}

	cout<<"-1 -1"<<endl;
	return(0);
}

Compiler output:
a.cc:33:9: error: 'cout' does not name a type
   33 |         cout<<"-1 -1"<<endl;
      |         ^~~~
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return(0);
      |         ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

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

int cnt[50];
int pos[50][100002];
char str[100002];

int main(){
	
	// Init
	for(int i=0;i<50;i++){cnt[i]=0;}
	
	// Input
	cin>>str;
	for(int i=0;i<strlen(str);i++){
		pos[str[i]-'a'][cnt[str[i]-'a']++]=i;
	}

	// Solve
	for(int i='a';i<='z';i++){
		int lk=i-'a';
		for(int j=0;j+1<cnt[lk];j++){
			int len = pos[lk][j+1] - pos[lk][j]+1;
				if(len/2 < 2){
					cout<<pos[lk][j]+1<<" "<<pos[lk][k]+1<<endl;
					return(0);
				}
				else break;
			}
		}
	}

	cout<<"-1 -1"<<endl;
	return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:74: error: 'k' was not declared in this scope
   25 |                                         cout<<pos[lk][j]+1<<" "<<pos[lk][k]+1<<endl;
      |                                                                          ^
a.cc: At global scope:
a.cc:33:9: error: 'cout' does not name a type
   33 |         cout<<"-1 -1"<<endl;
      |         ^~~~
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return(0);
      |         ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int N = s.length();
		char[] c = s.toCharArray();
		int a = 0;
		int b = 0;
		for (int i=1;i<N;i++) {
			if (c[i]==c[i-1]) {
				System.out.println(i + " " + (i+1));
				return;
			}
		}

		for (int i=2;i<N;i++) {
			if (c[i]==c[i-2]) {
				System.out.println((i-1) + " " + (i+1));
				return;
			}
		}

		System.out.println(-1 + " " + -1);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main(){
  string V;
  cin >> s;
  
  bool balanced = false;
  int a, b;
  int N = s.size();
  for(int i = 0; i < N-1; i++){
    if(s[i] == s[i+1]){
      balanced = true;
      a = i, b = i+1;
    }
  }
  for(int i = 0; i < N-2; i++){
    if(s[i] == s[i+2] && s[i] != s[i+1]){
      balanced = true;
      a = i, b = i+2;
    }
  }
  a++, b++;
  if(!balanced) a = -1, b = -1;
  cout << a << " " << b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int main(){
  string V;
  cin >> s;
  
  bool balanced = false;
  int a, b;
  for(int i = 0; i < N-1; i++){
    if(s[i] == s[i+1]){
      balanced = true;
      a = i, b = i+1;
    }
  }
  for(int i = 0; i < N-2; i++){
    if(s[i] == s[i+2] && s[i] != s[i+1]){
      balanced = true;
      a = i, b = i+2;
    }
  }
  a++, b++;
  if(!balanced) a = -1, b = -1;
  cout << a << " " << b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
a.cc:13:22: error: 'N' was not declared in this scope
   13 |   for(int i = 0; i < N-1; i++){
      |                      ^
a.cc:19:22: error: 'N' was not declared in this scope
   19 |   for(int i = 0; i < N-2; i++){
      |                      ^