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

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <cmath>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
constexpr int INF = INT_MAX;

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

int main() {
	int n;
	cin >> n;
	int sum = 0;
	VI a(n);
	REP(i,0,n) {
		cin >> a[i];
		sum += a[i];
	}
	int dst = round(1.0*sum/n);
	int ans = 0;
	REP(i,0,n) {
		ans += (a[i] - dst) * (a[i] - dst);
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc:53:21: error: 'INT_MAX' was not declared in this scope
   53 | constexpr int INF = INT_MAX;
      |                     ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include <cmath>
  +++ |+#include <climits>
   17 |
Language: C++

import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;

public class Main {

	void solve() {
		int N = sc.nextInt();
		int[] a = sc.nextIntArray(N);
		
		int ans = Integer.MAX_VALUE;
		for (int c = -100; c <= 100; c++) {
			int y = check(a, c);
			ans = Math.min(ans, y);
		}
		out.println(ans);
	}
	
	int check(int [] a, int c) {
		int res = 0;
		for (int x : a) res += (x - c) * (x - c);
		return res;
	}
	
	static void tr(Object... os) { System.err.println(deepToString(os)); }
	static void tr(int[][] as) { for (int[] a : as) tr(a); }

	void print(int[] a) {
		out.print(a[0]);
		for (int i = 1; i < a.length; i++) out.print(" " + a[i]);
		out.println();
	}

	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	MyScanner sc = null;
	PrintWriter out = null;
	public void run() throws Exception {
		sc = new MyScanner(System.in);
		out = new PrintWriter(System.out);
		for (;sc.hasNext();) {
			solve();
			out.flush();
		}
		out.close();
	}

	class MyScanner {
		String line;
		BufferedReader reader;
		StringTokenizer tokenizer;

		public MyScanner(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}
		public void eat() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					line = reader.readLine();
					if (line == null) {
						tokenizer = null;
						return;
					}
					tokenizer = new StringTokenizer(line);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}
		public String next() {
			eat();
			return tokenizer.nextToken();
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		public boolean hasNext() {
			eat();
			return (tokenizer != null && tokenizer.hasMoreElements());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import static java.lang.Math.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import static java.util.Arrays.*;
      | ^~~~~~
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.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

///#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
///#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

/*
    zet:
        find_by_order(k): k-stat [k > 0]
        order_of_key(k) : {el < k}

    gp_hash_table<key, val, custom_hash>

    rope<T>:
        iterators: mutable_begin, ..
        methods  : erase, insert, substr, ..
*/

#define all(x) (x).begin(), (x).end()
#define size(x) (int)((x).size())
#define em_back emplace_back

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<typename T>
using zet = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

mt19937 eng(chrono::steady_clock::now().time_since_epoch().count());

bool check(string& s) {
    static int let['z' - 'a' + 1];
    memset(let, 0, sizeof let);

    for (char c : s) {
        let[c - 'a']++;
        if (let[c - 'a'] * 2 > size(s)) {
            return true;
        }
    }
    return false;
}

void solve() {
    string s;
    cin >> s;

    for (int i = 0; i < size(s); ++i) {
        for (int j = i + 1; j < size(j) && j - i + 1 < 4; ++j) {
            string t = s.substr(i, j - i + 1);
            if (check(t)) {
                cout << i + 1 << " " << j + 1 << "\n";
                return;
            }
        }
    }
    cout << "-1 -1\n";
}

int main() {
    ios::sync_with_stdio(0);
    cout.tie(0), cin.tie(0);

    int z = 1;
    /// cin >> z;

    while (z--) {
        solve();
    }

    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:22:27: error: request for member 'size' in 'j', which is of non-class type 'int'
   22 | #define size(x) (int)((x).size())
      |                           ^~~~
a.cc:72:33: note: in expansion of macro 'size'
   72 |         for (int j = i + 1; j < size(j) && j - i + 1 < 4; ++j) {
      |                                 ^~~~
Language: C++

b#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 100010;

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

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | b#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'b' does not name a type
    1 | b#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'ios' has not been declared
    7 |         ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |         ^~~
a.cc:7:38: error: 'cin' was not declared in this scope
    7 |         ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |                                      ^~~
a.cc:7:50: error: 'cout' was not declared in this scope
    7 |         ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
      |                                                  ^~~~
a.cc:8:9: error: 'string' was not declared in this scope
    8 |         string s;
      |         ^~~~~~
a.cc:9:16: error: 's' was not declared in this scope
    9 |         cin >> s ;
      |                ^
a.cc:12:56: error: 'endl' was not declared in this scope
   12 |                         cout << i + 1 << ' ' << i+2 << endl;
      |                                                        ^~~~
a.cc:16:56: error: 'endl' was not declared in this scope
   16 |                         cout << i + 1 << ' ' << i+3 << endl;
      |                                                        ^~~~
a.cc:20:28: error: 'endl' was not declared in this scope
   20 |         cout << "-1 -1" << endl;
      |                            ^~~~
Language: C++

#include <iostream>
#include<string>
using namespace std;
int main()
{
	string s;
	int mark = 0;
	for (int i = 0; i <= s.length()-1; i++)
	{
		if (s[i] == s[i + 1] && i + 1 < s.length())
		{
			mark = 1;
			cout << i + 1 << " " << i + 2 << endl;
			break;
		}
		else if (s[i] == s[i + 2] && i + 2 < s.length())
		{
			cout << i + 1 << " " << i + 3 << endl;
			mark = 1;
			break;
		}
	}
	if (mark == 0)
		cout << -1 << " " << -1 << endl;
	}
}

Compiler output:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long
ll dp[5009];
  ll a[5000];
int main()
{
   string s;cin>>s;
   for(int i=0;i<s.size();i++){
       set<char>ss;
       ss.insert(s[i]);
       if(i+1<s.size()){
       ss.insert(s[i+1]);
          if(ss.size()==1){
           cout<<i+1<<" "<<i+2;
           return 0;
       } 
       }
       if(i+2<s.size()){
       ss.insert(s[i+2]);

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: expected '}' at end of input
   22 |        ss.insert(s[i+2]);
      |                          ^
a.cc:21:24: note: to match this '{'
   21 |        if(i+2<s.size()){
      |                        ^
a.cc:22:26: error: expected '}' at end of input
   22 |        ss.insert(s[i+2]);
      |                          ^
a.cc:11:31: note: to match this '{'
   11 |    for(int i=0;i<s.size();i++){
      |                               ^
a.cc:22:26: error: expected '}' at end of input
   22 |        ss.insert(s[i+2]);
      |                          ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char a[100005];
int p[60][100005],len[30],n;
void f(char a,int k){
	int s;
	if('a' <= a && a <= 'z') s = a - 'a' + 1;
	if('A' <= a && a <= 'Z') s = a - 'A' + 27;
	p[s][++len[s]] = k;
}
signed main(){
//	freopen("date.in","r",stdin);
//	freopen("date.out","w",stdout);
	gets(a);
	n = strlen(a) - 1;
	for(int i = 1; i <= n; i++) f(a[i],i);
	for(int i = 1; i <= 52; i++){
		for(int j = 2; j <= len[i]; j++){
			if(p[i][j] - p[i][j - 1] <= 2){
				printf("%d %d",p[i][j - 1],p[i][j]);
				return 0;
			}
		}
	}
	printf("-1 -1");
}



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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const ll MOD2=998244353;
const double PI=acos(-1);
const ll INF=1e15;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

int main() {
  string s;
  cin >> s;
  ll k=s.size();
  ll l=-1,r=-1;
  rep(i,n-1){
    if(s[i]==s[i+1]){
      l=i+1;r=i+2;
    }
  }
  rep(i,n-2){
    if(s[i]==s[i+2]){
      l=i+1;
      r=i+3;
    }
  }
  cout << l << " " << r << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'n' was not declared in this scope
   22 |   rep(i,n-1){
      |         ^
a.cc:11:33: note: in definition of macro 'FOR'
   11 | #define FOR(i,a,b) for(ll i=a;i<b;i++)
      |                                 ^
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(i,n-1){
      |   ^~~
a.cc:27:9: error: 'n' was not declared in this scope
   27 |   rep(i,n-2){
      |         ^
a.cc:11:33: note: in definition of macro 'FOR'
   11 | #define FOR(i,a,b) for(ll i=a;i<b;i++)
      |                                 ^
a.cc:27:3: note: in expansion of macro 'rep'
   27 |   rep(i,n-2){
      |   ^~~
Language: Java

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

public class B {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        char[] s = in.ns().toCharArray();
        boolean flag = false;
        for (int i = 0; i < s.length-1; i++) {
            if(i<s.length-2){
                if(s[i]==s[i+1]||s[i]==s[i+2]){
                    out.printf("%d %d\n",i+1, i+3);
                    flag = true;
                }
            }else{
                if(s[i]==s[i+1]){
                    out.printf("%d %d\n",i+1, i+2);
                    flag = true;
                }
            }
            if(flag) break;
        }
        if(!flag) out.println("-1 -1");
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

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

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T>>
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() { 
  string s;
  cin >> s;
  int n = sz(s);
  if(n==2){
    if(s[i] == s[i+1]){
      cout<<1<<" "<<2<<endl;
      return 0;
    }
  }
  rep(i,n-2){
    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:44:10: error: 'i' was not declared in this scope
   44 |     if(s[i] == s[i+1]){
      |          ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    char arr[100000];
    scanf("%s",arr);
    int n=strlen(arr);
    int p=0,a,b;
    for(int i=0;i<n-2;i++)
    {
        if(arr[i]==arr[i+1])
        {
            p=1;
            a=i;
            b=i+1;
            break;
        }
        else if(arr[i]==arr[i+2])
        {
            p=1;
            a=i;
            b=i+2;
            break;
        }
    }
    if(arr[n-2]==arr[n-1])
    {
        p=1;
        a=n-2;
        b=n-1;
    }
    if(p)
    {
        cout<<a+1<<' '<<b+1;
    }
    else
    {
        cout<<"-1 -1";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'strlen' was not declared in this scope
    7 |     int n=strlen(arr);
      |           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;
int main()
{
    char arr[100000];
    scanf("%s",&arr);
    int n=strlen(arr);
    int p=0,a,b;
    for(int i=0;i<n-2;i++)
    {
        if(arr[i]==arr[i+1])
        {
            p=1;
            a=i;
            b=i+1;
            break;
        }
        else if(arr[i]==arr[i+2])
        {
            p=1;
            a=i;
            b=i+2;
            break;
        }
    }
    if(arr[n-2]==arr[n-1])
    {
        p=1;
        a=n-2;
        b=n-1;
    }
    if(p)
    {
        cout<<a+1<<' '<<b+1;
    }
    else
    {
        cout<<"-1 -1";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'strlen' was not declared in this scope
    7 |     int n=strlen(arr);
      |           ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
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 <iostream>
#include <vector>
 
using namespace std;
 
int main(){

  string s;
  
  cin >> s;
  
  int a[30]={0};
  
  for(int i=0;i<s.size();i++){
    
    a[s[i]-'a']++;
    for(int j=0;j<26;j++){
      
    if(a[j]> i/2 && a[j] != 1){
      
      cout << "1" << " " << i << endl;
      
      return 0;
      
    }
      
    }
    
    cout << "-1" << " " << "-1" << endl;
    
  }

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

#include<bits/stdc++.h>
using namespace std;
main(){
  string S;cin>>S;
  int n=S.size();
  if(n==2){
    if(S[0]==S[1])cout<<"0 1"<<endl;
    else cout<<"-1 -1"endl;
    return 0;
  }
  for(int i=0;i<n-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:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:16: error: unable to find string literal operator 'operator""endl' with 'const char [6]', 'long unsigned int' arguments
    8 |     else cout<<"-1 -1"endl;
      |                ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
char s[N];
int main()
{
	//freopen("H:\\c++1\\in.txt","r",stdin);
	//freopen("H:\\c++1\\out.txt","w",stdout);
	scanf("%s",s+1);
	int len=strlen(s+1);
	int l=-1,r=-1;
	for(int i=1;i<len;i++){
		if(s[i]==s[i+1]){
			flag=1;
			l=i,r=i+1;
			break;
		}
	}
	printf("%d %d\n",l,r);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 'flag' was not declared in this scope
   14 |                         flag=1;
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){
	if(y<h && y>=0 && x<w && x>=0) return true;
	return false;
}





int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;cin >> s;
	int a = 0, b = 0;
	rep(i,s.size() - 2){
		if(s.at(i) == s.at(i + 1) && s.at(i) != s.at(i + 2)){
			a = i;
			b = i + 2;
			break;
		}
		else if(s.at(i) == s.at(i + 2) && s.at(i) != s.at(i + 1)){
			a = i;
			b = i + 2;
			break;
		}
		else if(s.at(i) != s.at(i + 1) && s.at(i + 1) == s.at(i + 2)){
			a = i;
			b = i + 2;
			break;
		}
	}
	rep(i,s.size() - 1){
		if(s.at(i) == s.at(i + 1)){
			a = i;
			b = i + 1;
		}
	if(b == 0) cout << "-1 -1" << endl;
	else cout << a + 1 << " " << b + 1 << endl;
}


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

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

public class Main
{
	public static void main(String[] args) { new Main(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);
	
	int len;
	char[] str;
	boolean found = false;
	
	Main() {
		len = (str = in.next().toCharArray()).length;
		for (int i = 0; i < len - 1; i++) {
			if (str[i] == str[i + 1]) {
				out.printf("%d %d%n", i + 1, i + 2);
				found = true;
				break;
			}
			if (i < len - 2 && str[i] == str[i + 2]) {
				out.printf("%d %d%n", i + 1, i + 3);
				found = true;
				break;
			}
		}
		if (!found)
			out.printf("%d %d%n", -1, -1);
		out.close();
	}
	
		
	
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenzier("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}


Compiler output:
Main.java:37: error: cannot find symbol
		StringTokenizer st = new StringTokenzier("");
		                         ^
  symbol:   class StringTokenzier
  location: class Main.FS
1 error
Language: C++

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc:3:1: error: 'string' does not name a type
    3 | string a,b;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>a;
      |     ^~~
a.cc:6:10: error: 'a' was not declared in this scope
    6 |     cin>>a;
      |          ^
a.cc:11:13: error: 'cout' was not declared in this scope
   11 |             cout<<s<<" "<<s+1<<endl;
      |             ^~~~
a.cc:11:32: error: 'endl' was not declared in this scope
   11 |             cout<<s<<" "<<s+1<<endl;
      |                                ^~~~
a.cc:19:13: error: 'cout' was not declared in this scope
   19 |             cout<<s-1<<" "<<s+1<<endl;
      |             ^~~~
a.cc:19:34: error: 'endl' was not declared in this scope
   19 |             cout<<s-1<<" "<<s+1<<endl;
      |                                  ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<-1<<" "<<-1<<endl;
      |     ^~~~
a.cc:23:24: error: 'endl' was not declared in this scope
   23 |     cout<<-1<<" "<<-1<<endl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
#define all(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  string s;cin>>s;
  if(s.size()==2){
    if(s[0]==s[1])cout<<"1 2";
    else cout<<"-1 -1";
  }else{
    rep(i,2,s.size()){
      if(s[i-2]==s[i-1]||s[i-2]==s[i]||s[i-1]==s[i]){
        cout<<i-1<<" "<<i+1;
        return 0;
      }
    }
    cout<<"-1 -1";
  }
}

Compiler output:
a.cc:15:21: error: macro "rep" passed 3 arguments, but takes just 2
   15 |     rep(i,2,s.size()){
      |                     ^
a.cc:7:9: note: macro "rep" defined here
    7 | #define rep(i,n) reps(i,0,n)
      |         ^~~
a.cc: In function 'int main()':
a.cc:15:5: error: 'rep' was not declared in this scope
   15 |     rep(i,2,s.size()){
      |     ^~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: 'gets' was not declared in this scope; did you mean 'getw'?
    4 |         string a; gets(a);
      |                   ^~~~
      |                   getw
a.cc:8:13: error: 'sum' was not declared in this scope
    8 |             sum++;
      |             ^~~
a.cc:11:8: error: 'sum' was not declared in this scope
   11 |     if(sum == 0){
      |        ^~~
a.cc:19:8: error: 'sum' was not declared in this scope
   19 |     if(sum == 0){
      |        ^~~
Language: C++

#include <iostream>
int a=-1,i; main(){
string s;
std::cin>>s;
for(i=0,i<s.length();i++;)if(s[i]==s[i+1]){if(i>0)a=i-1;else a=i;}
if(a!=-1)std::cout<<a<<" "<<a+2;
else std::cout<<-1<<" "<<-1;
}


Compiler output:
a.cc:2:13: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | int a=-1,i; main(){
      |             ^~~~
a.cc: In function 'int main()':
a.cc:3:1: error: 'string' was not declared in this scope
    3 | string s;
      | ^~~~~~
a.cc:3:1: 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:4:11: error: 's' was not declared in this scope
    4 | std::cin>>s;
      |           ^
Language: C++

s = input()
is_unbalanced = False
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        is_unbalanced = True
        break
if is_unbalanced == False:
    for i in range(len(s)-2):
        if s[i] == s[i+2]:
            print(i+1, i+2)
            is_unbalanced = True
            break
if is_unbalanced == False:
    print(-1, -1)


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (500000)
#define pii pair<int, int>

/////////////////////////////////////////////////////////

class XY{
public:
  ll x, y;
  XY() {x = y = 0;}
  XY(ll u, ll v) {x = u; y = v;}
};

class e{
public:
  ll a, b;
  e() {a = b = -1;}
  e(ll u, ll v) {a = u; b = v;}
};

template<typename T1, typename T2>
void chmin(T1 &a, T2 b) {if(a > b) a = b;}
template<typename T1, typename T2>
void chmax(T1 &a, T2 b) {if(a < b) a = b;}

template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
  if(n == 0) return 1;
  if(n == 1) return a;
  if(n % 2) return a * mypow(a, n - 1);
  ll tmp = mypow(a, n / 2);
  return tmp * tmp;
}

template<typename T>
int BS(vector<T> &V, int left, int right, T key){
  int mid = (left + right) / 2;
  if(V[mid] <= key) left = mid;
  else right = mid;
  if(right - mid == 1) return left;
  else return BS(V, left, right, key);
}

ll comb(ll n, ll r){
	ll res = 1;
  rep(i, 0, r){
    res *= n - i;
    res /= i + 1;
  }
  return res;
}

template<typename T>
T euclid(T a, T b){
  if(b == 0) return a;
  else return euclid(b, a % b);
}

vector<ll> fact(MAX, 0), fact_inv(MAX, 0);

ll pow_mod(ll a, ll b){
	ll res = 1;
	while(b > 0){
		if(b & 1) res = res * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return res;
}

void prepare_comb_mod(ll n){
	fact[0] = 1LL;
	for(ll i = 0; i < n; i++) fact[i+1] = fact[i] * (i + 1) % MOD;
	fact_inv[n] = pow_mod(fact[n], MOD - 2);
	for(ll i = n - 1; i >= 0; i--) fact_inv[i] = fact_inv[i + 1] * (i + 1) % MOD;
}

ll comb_mod(ll n, ll r){
	return (fact[n] * fact_inv[r]) % MOD * fact_inv[n - r] % MOD;
}

/////////////////////////////////////////////////////////

void Main() {
  string S; cin >> S;
  rep(i, 0, S.size() - 1){
    if(S[i] == S[i + 1]){
      if(i == 0){
        cout << i + 1 << " " << i + 3 << endl;
        return;
      }else{
        cout << i << " " << i + 2 << endl;
        return;
      }
    }
    if(i == N - 1) continue;
    if(S[i] == S[i + 2]){
      cout << i + 1 << " " << i + 3 << endl;
    }
  }
  cout << -1 << " " << -1 << endl;
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);

  Main();
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:102:13: error: 'N' was not declared in this scope
  102 |     if(i == N - 1) continue;
      |             ^
Language: C++

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
typedef long long ll;
const int mo = 1e9 + 7;
#define rep(i, n) for (int i = 0; i < n; i++)
char str[210000];
void solve()
{
    scanf("%s",str);
    int n=strlen(str);
    rep(i,n-1)if(str[i]==str[i+1]){printf("%d %d\n",i+1,i+2);return 0;}
    rep(i,n-2)if(str[i]==str[i+1]){printf("%d %d\n",i+1,i+3);return 0;}
}
main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:17:11: error: 'strlen' was not declared in this scope
   17 |     int n=strlen(str);
      |           ^~~~~~
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <stack>
  +++ |+#include <cstring>
    9 | using namespace std;
a.cc:18:69: error: return-statement with a value, in function returning 'void' [-fpermissive]
   18 |     rep(i,n-1)if(str[i]==str[i+1]){printf("%d %d\n",i+1,i+2);return 0;}
      |                                                                     ^
a.cc:19:69: error: return-statement with a value, in function returning 'void' [-fpermissive]
   19 |     rep(i,n-2)if(str[i]==str[i+1]){printf("%d %d\n",i+1,i+3);return 0;}
      |                                                                     ^
a.cc: At global scope:
a.cc:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 | main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;

void solve(string s){
	rep(i, s.length()-1) {
		if (s[i] == s[i+1]) {
			cout << i+1 << " " << i+2 << endl;
			return 0;
		}
		if (s[i] == s[i+2]) {
			cout << i+1 << " " << i+3 << endl;
			return 0;
		}
	}
	cout << "-1 -1" << endl;
}

int main(){	
	string s;
	cin >> s;
	solve(s);
	return 0;
}



Compiler output:
a.cc: In function 'void solve(std::string)':
a.cc:27:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   27 |                         return 0;
      |                                ^
a.cc:31:32: error: return-statement with a value, in function returning 'void' [-fpermissive]
   31 |                         return 0;
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long n,i,j,d=1,b[100000],k;
	char s[1000000];
	gets(s);
	cout<<"-1 -1";
}

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

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

int main(){
	char a[100000];
	gets(a);
	int c[100000];
	for(int i = 97; i <= 122; i++){
		c[0] = 0;
		for(int j = 0; j < strlen(a) ; j++){
			if(a[j] == i){
				c[j + 1] = c[j] + 1;
			} else {
				c[j + 1] = c[j];
			}
		}
		for(int j = 1; j < strlen(a); j++){
			for(int k = j + 1; k < strlen(a); k++){
				if(2 * (c[k] - c[j - 1]) > k - j + 1){
					cout << j << " " << k;
					return 0;
				}
			}
		}
	}
	cout << -1 << " " << -1;
}

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

#include<iostream>
using namespace std;

int main(){
	int a = -1,b = -1;
	char s[100000];
	scanf("%s",s);
	
	for(int i  = 0; i < n; i++){
		if(s[i] == s[i+1] ){
			a = i;
			b = i +1;
			break;
		}
		if(s[i] == s[i+2]){
			a = i;
			b = i+2;
			break 
		}
	}
	
	cout << a << " " << b << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'n' was not declared in this scope
    9 |         for(int i  = 0; i < n; i++){
      |                             ^
a.cc:18:30: error: expected ';' before '}' token
   18 |                         break
      |                              ^
      |                              ;
   19 |                 }
      |                 ~
Language: C++

//
/*==========================================================*/
/*    Template ver 2017-0720    |    Created by JollyBee    */
/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */
/*==========================================================*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
const double EPS=(double)1e-9;
const double PI=(double)acos(-1.0);
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define FOR(i,n) for(int i=0;i<n;i++)
#define REPP(i,l,r,c) for(int i=l;i<=r;i+=c)
#define REP(i,l,r) REPP(i,l,r,1)
#define FORD(i,n) for(int i=n-1;i>=0;i--)
#define REVV(i,l,r,c) for(int i=l;i>=r;i-=c)
#define REV(i,l,r) REVV(i,l,r,1)
//random
int irand(int lo, int hi){
    return (((double)rand())/(RAND_MAX+1.0)) * (hi-lo+1) + lo;
}
//ll to string
string toString(ll x) {
    stringstream ss;
    ss << x;
    return ss.str();
}
//string to ll
ll toNumber(string S) {
    ll ret;
    sscanf(S.c_str(),"%lld",&ret);
    return ret;
}
// std::fill(start, end, value);
// for(auto it: DS){}

const int INF=(int)2e9;
const ll MOD=(ll)1e9+7;
/*==========================================================*/
/*                     END OF TEMPLATE                      */
/* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */
/*==========================================================*/

int s[100005];

pii solve(){
    int n = strlen(s+1);
    REP(pos,1,n-2) REP(i,pos,pos+2) REP(j,i+1,pos+2){
        if(s[i] == s[j]) return mp(pos,pos+2);
    }
    return mp(-1,-1);
}

int main(){
    scanf("%s", s+1);
    pii res = solve();
    printf("%d %d\n", res.fi, res.se);
    return 0;
}


Compiler output:
a.cc: In function 'pii solve()':
a.cc:58:21: error: cannot convert 'int*' to 'const char*'
   58 |     int n = strlen(s+1);
      |                    ~^~
      |                     |
      |                     int*
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:6:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include <cstdio>
const int N=100005;
char a[N];
int main (){
  scanf ("%s",a+1);
  int n=strlen(a+1);
  if (n==2) {
    if (a[1]==a[2]) puts("1 2");
    else puts("-1 -1");
    return 0;
  }
  for (int i=1;i<=n-2;i++)
    if ((a[i]==a[i+1])||(a[i]==a[i+2])||(a[i+1]==a[i+2])){
      printf ("%d %d",i,i+2);return 0;
  	}
  puts("-1 -1");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'strlen' was not declared in this scope
    6 |   int n=strlen(a+1);
      |         ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <cstdio>
  +++ |+#include <cstring>
    2 | const int N=100005;
Language: C++

#include <bits/stdc++.h> //JuniorMonster a.k.a Sho10
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio();cin.tie();cout.tie();
using namespace std;
ll n,cnt[27];
string s;
int32_t main(){
CODE_START;
cin >> s;
n=s.size();
if(n==2){
    cout << "-1" << ' ' << "-1";
    return 0; 
}
for(ll i=0;i<n-1;i++)
if(s[i]==s[i+1]){
        if(i!=n-2){
    cout << i+1 << ' ' << i+3;
    return 0;
        }else if(i==n-2){
        cout<< i << ' ' <<i+2;
        return 0;
}
cout << "-1" << ' ' <<"-1";
return 0;}



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

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

int main(){
  string s; cin >> s;
  for(int i=0;i<n-2;i++) {
  	if(s[i]==s[i+1]||s[i+1]==s[i+2]||s[i]==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:6:17: error: 'n' was not declared in this scope
    6 |   for(int i=0;i<n-2;i++) {
      |                 ^
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String t = sc.next();
		sc.close();
		int n = t.length();
		if(n <= 2) {
			System.out.println("-1 -1");
			System.exit(0);
		}
		for(int i = 0; i < n - 2; i++) {
			char c0 = t.charAt(i);
			char c1 = t.charAt(i + 1);
			char c2 = t.charAt(i + 2);
			int[] k = new int[26];
			k[(int)(c0 - 'a')]++;
			k[(int)(c1 - 'a')]++;
			k[(int)(c2 - 'a')]++;
			Arrays.sort(k);
			if(k[25] == 2) {
				System.out.printf("%d %d\n", i + 1, i + 3);
				System.exit(0);
			}
		}
		System.out.println("-1 -1");
	}
}



Compiler output:
Main.java:21: error: cannot find symbol
			Arrays.sort(k);
			^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

#include <iostream>
#include <malloc.h>
#include<stack>
#include<map>
#include<stdio.h>
#include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;

struct Node
{
    int a;
    char c;
}w[1000000];
int n;
bool cmp(Node a,Node b)
{
    return a.c<b.c;
}
int main()
{  set<char>s;
  int i;
    string ss;
    cin>>ss;
    int len=ss.length();
    for(int i=0;i<len;i++)
    {
        s.insert(ss[i]);
        w[i].c=ss[i];
        w[i].a=i+1;

    }
    sort(w,w+len,cmp);
    if(len==s.size())
     printf("-1 -1\n");
     else
     {
          for(i=1;i<len;i++)
          {
               if(w[i].c==w[i-1].c)
               {
                   int t=abs(w[i].a-w[i-1].a);
                   if(t<=3)
                    if(w[i].a<w[i-1].a)
                   {
                       printf("%d %d",w[i].a,w[i].a);
                       break;
                   }
                   else
                   {
                         printf("%d %d",w[i].a,w[i].a);
                         break
                   }
                }
     }
     }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:31: error: expected ';' before '}' token
   52 |                          break
      |                               ^
      |                               ;
   53 |                    }
      |                    ~
Language: C++

#include<cstdio>
using namespace std;
#include<cstring>

int main(){
  char s[100010];
  int n;
  scanf("%s",s);
  n=strlen(s);
  for(int i=0;i<n-2;i++){
    if(s[i]==s[i+1]){
      printf("%d %d\n",i,i+1);
      return 0;
    }
    else if(s[i]==s[i+2]){
      printf("%d %d\n",i,i+2);
      return 0;
    }
  }
  if(s[n-2]==s[n-1]){
    peinrf("%d %d\n",n-2,n-1);
    return 0;
  }
  printf("-1 -1\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'peinrf' was not declared in this scope; did you mean 'printf'?
   21 |     peinrf("%d %d\n",n-2,n-1);
      |     ^~~~~~
      |     printf
Language: C++

#include<stdio.h>
int main(){
char s[111111];
int i,a=-1,b=-1;
for(i=0;i<111111;i++)
s[i]='\0';
scanf("%s",s);
if(s[0]==s[1]){
a=1;
b=2;
for(i=2;s[i]!='\0';i++){
if(s[i]==s[i-1]){
a=i;
b=i+1;
}
if(s[i]==s[i-2]){
a=i-1;
b=i+1;
}
}
printf("%d %d\n",a,b);
return 0;
}

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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  n=s.size();
  REP(i,n){
    if(s[i]==s[i+1]){
      cout << i << " " << i+1 << endl;
    }elif(s[i]==s[i+2]){
      cout << i << " " << i+2 << endl;
    }
  }
  cout << -1 << " " << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: 'n' was not declared in this scope
   38 |   n=s.size();
      |   ^
Language: C++

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

void die(int x, int y) {
  cout << x << " " << y;
  die(0);
}

int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 1; i < n; ++i)
    if (s[i] == s[i - 1])
      die(i, i + 1);
    else if (i - 2 >= 0 && s[i - 2] == s[i])
      die(i - 1, i + 1);
  cout << "-1 1";
}

Compiler output:
a.cc: In function 'void die(int, int)':
a.cc:7:6: error: too few arguments to function 'void die(int, int)'
    7 |   die(0);
      |   ~~~^~~
a.cc:5:6: note: declared here
    5 | void die(int x, int y) {
      |      ^~~