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

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

using namespace std;

int main(){
  string V;
  cin >> s;
  
  bool valanced = false;
  int a, b;
  for(int i = 0; i < N-1; i++){
    if(s[i] == s[i+1]){
      valanced = 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]){
      valanced = true;
      a = i, b = i+2;
    }
  }
  a++, b++;
  if(!valaced) 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++){
      |                      ^
a.cc:26:7: error: 'valaced' was not declared in this scope; did you mean 'valanced'?
   26 |   if(!valaced) a = -1, b = -1;
      |       ^~~~~~~
      |       valanced
Language: C++

#include <iostream>

int main(){
  std::cout << "2 4" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |   std::cout << "2 4" << endl;
      |                         ^~~~
      |                         std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

int main(){
  cout << "2 4" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    4 |   cout << "2 4" << endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:4:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |   cout << "2 4" << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

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

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[] a = new char[n];
    a = s.toCharArray();

    int r = (int)Math.pow(2, m);
    int k = m / 2 + (m % 2 == 1 ? 1 : 0);

    for (int i = 0; i < n - 1; i++) {
      if (a[i] == a[i+1]) {
        System.out.println((i + 1) + " " + (i + 2));
        return;
      }
      if (i != n - 2 && a[i] == a[i+2]){
        System.out.println((i + 1) + " " + (i + 3));
        return;
      }
    }
    
    System.out.println("-1 -1");
  }
}

Compiler output:
Main.java:13: error: cannot find symbol
    int r = (int)Math.pow(2, m);
                             ^
  symbol:   variable m
  location: class Main
Main.java:14: error: cannot find symbol
    int k = m / 2 + (m % 2 == 1 ? 1 : 0);
            ^
  symbol:   variable m
  location: class Main
Main.java:14: error: cannot find symbol
    int k = m / 2 + (m % 2 == 1 ? 1 : 0);
                     ^
  symbol:   variable m
  location: class Main
3 errors
Language: C++

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

using namespace std;
using ll = long long;

constexpr static ll MOD = 1000000007ll;
constexpr static int INF = 1 << 28; // for x <= 10^9
constexpr static ll INFL = 1ll << 60; // for x <= 10^19

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

    if (s.length == 2) {
        if (s[0] == s[1]) {
            cout << 1 << " " << 2 << endl;
            return 0;
        } else {
            cout << "-1 -1" << endl;
            return 0;
        }
    }

    for (int i = 0; i < s.length() - 2; i++) {
        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;
        }

        if (s[i + 1] == s[i + 2]) {
            cout << i + 2 << " " << i + 3 << endl;
            return 0;
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   19 |     if (s.length == 2) {
      |         ~~^~~~~~
      |                 ()
Language: C++

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

int main(){
	cin>>s;
	int len=strlen(s);
	bool flag=0;
	for(int i=0;i<len;i++){
		if(s[i]==s[i+1]){
			printf("%d %d\n",i+1,i+2);
			flag=1;
			break;
		}
		else if(s[i]==s[i+2]){
			printf("%d %d\n",i+1,i+3);
			flag=1;
			break;
		}
	}
	if(!flag) printf("-1 -1\n");
	return 0;
}


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

#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 28, MOD = 1e9 + 7; constexpr ll LINF = 1ll << 60; constexpr double EPS = 1e-6;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

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

    pair<int, int> ans(-1, -1);
    if (S[0] == S[1]) ans = mp(1, 2);
    if (S.size() > 2) {
        rep(i, 2, S.size()) {
            if (S[i - 1] == S[i]) ans = mp(i, i + 1);
            else if (S[i - 2] == S[i]) ans = mp(i - 1, i + 1);
        }
    }

    cout << ans.first << " " << ans.second << endl;
}

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

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

#define boost ios::sync_with_stdio(0); cin.tie(0);
#define int long long
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;

int main(){
    boost;
    string s;

    cin >> s;

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


    for(int i = 0 ; i < s.length()-2; ++i){
    	if(s[i] == s[i+2]){
    		cout << i+1 << " " << i+3;
    		return 0;
    	}
    }

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

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	string s;cin >> s;
    rep(i, s.length()-2){
        if(s[i] == s[i+2]){
            printf("%d %d",i+1,i+3);
            return 0;
        }else if(s[i] == s[i+1]){
            printf("%d %d",i+1,i+2);
            return 0;
        }
    }
    if(s.length==2&&s[0]==s[1]){
        printf("1 2");
    }
	cout << "-1 -1" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |     if(s.length==2&&s[0]==s[1]){
      |        ~~^~~~~~
      |                ()
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before 'return'
   14 |     cout << "-1 -1"
      |                    ^
      |                    ;
   15 |     return 0;
      |     ~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope
    8 |     for(i=1; i<n; i++){
      |                ^
a.cc:14:20: error: expected ';' before 'return'
   14 |     cout << "-1 -1"
      |                    ^
      |                    ;
   15 |     return 0;
      |     ~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
a.cc:7:16: error: 'n' was not declared in this scope
    7 |     for(i=1; i<n; i++){
      |                ^
a.cc:13:20: error: expected ';' before 'return'
   13 |     cout << "-1 -1"
      |                    ^
      |                    ;
   14 |     return 0;
      |     ~~~~~~
Language: C++

s = gets.chomp
# num = ('a'..'z').to_a.map{|a| [a,0]}.to_h
# s.chars.each_with_index do |b,i|
#   num[b] = i 
# end
s = s.chars
s.each_with_index do |b,i|
  if b == s[i + 1]
    puts i+1,i+2
    exit 
  elsif b == s[i + 2]
    puts i+1,i+3
    exit
  end 
end
puts "-1 -1"


Compiler output:
a.cc:2:3: error: invalid preprocessing directive #num
    2 | # num = ('a'..'z').to_a.map{|a| [a,0]}.to_h
      |   ^~~
a.cc:3:3: error: invalid preprocessing directive #s
    3 | # s.chars.each_with_index do |b,i|
      |   ^
a.cc:4:5: error: invalid preprocessing directive #num
    4 | #   num[b] = i
      |     ^~~
a.cc:5:3: error: invalid preprocessing directive #end; did you mean #endif?
    5 | # end
      |   ^~~
      |   endif
a.cc:1:1: error: 's' does not name a type
    1 | s = gets.chomp
      | ^
Language: Java

import java.io.*;
import java.lang.*;
import java.util.*;
public class Main{
  public static void main(String args[]){
    String S = new Scanner(System.in).nextLine();
    for(int i = 0; i < S.length(); i++){
      for(int j = i; j < S.length()-i; j++){ 
        String[] s = S.substring(i,j).split("");
        Set<String> chars = Set.copyOf(Arrays.asList(s));
        for(String c:chars){
          if((s.count(c) > s.length/2) && s.length > 1){
            System.out.println(i+1 +" "+ j);
            System.exit(0);
          }
        }
      }
    }
  System.out.println("-1 -1");
  }
}
      

Compiler output:
Main.java:12: error: cannot find symbol
          if((s.count(c) > s.length/2) && s.length > 1){
               ^
  symbol:   method count(String)
  location: variable s of type String[]
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before ':' token
   15 |       cout << i << " " << i + 2 << "\n":
      |                                        ^
      |                                        ;
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-1;i++)
    if(s[i]==s[i+1]){cout<<i+1<<" "<<i+2<<endl;return 0;}
  
  for(int i=0;i<n-2;i++)
    if(s[i]==s[i+2]){cout<<i+1<<" "<<i+3<<endl;return 0:
                    }
  
  cout<<"-1 -1\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:56: error: expected ';' before ':' token
   13 |     if(s[i]==s[i+2]){cout<<i+1<<" "<<i+3<<endl;return 0:
      |                                                        ^
      |                                                        ;
a.cc:13:56: error: expected primary-expression before ':' token
Language: C++

#include<cstring>
using namespace std;
int main(){
	string s;
	cin>>s;
	int l=s.length();
	for(int i=0;i<l-2;i++){
		if(s[i]==s[i+1]){
			cout<<i+1<<" "<<i+2;
			return 0;
		}
		else if(s[i]==s[i+2]){
			cout<<i+1<<" "<<i+3;
			return 0;
		}
	}
	if(s[l-2]==s[l-1]){
		cout<<l-1<<" "<<l;
		return 0; 
	}
	cout<<-1<<" "<<-1; 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string s;
      |         ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<cstring>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstring>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:5:14: error: 's' was not declared in this scope
    5 |         cin>>s;
      |              ^
a.cc:9:25: error: 'cout' was not declared in this scope
    9 |                         cout<<i+1<<" "<<i+2;
      |                         ^~~~
a.cc:9:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout<<i+1<<" "<<i+3;
      |                         ^~~~
a.cc:13:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout<<l-1<<" "<<l;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout<<-1<<" "<<-1;
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;
int main()
{
int n
cin>>n;
int a[n+1];
for(int i=1;i<=n;i++)
cin>>a[i];
do{
}while(1);
cout<<a[1];
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: expected initializer before 'cin'
    6 | cin>>n;
      | ^~~
a.cc:7:7: error: 'n' was not declared in this scope
    7 | int a[n+1];
      |       ^
a.cc:9:6: error: 'a' was not declared in this scope
    9 | cin>>a[i];
      |      ^
a.cc:12:7: error: 'a' was not declared in this scope
   12 | cout<<a[1];
      |       ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    string s;
    cin >> s;
    if(s.size() <= 2){
        cout << -1 " " << -1;
        return 0;
    }
    REP(i, s.size() - 2){
        if(s[i] == s[i + 1] || s[i + 1] == s[i + 2] || s[i] == s[i + 2]){
            cout << i + 1 << " " << i + 3;
            return 0;
        }
    }
    cout << -1 << " " << -1;
    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: expected ';' before string constant
   29 |         cout << -1 " " << -1;
      |                   ^~~~
      |                   ;
Language: C++


#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define output(x) cout<<x<<endl;
int par[100001];

void init(int n) {
	for (int i = 0; i < n; i++) {
		par[i] = i;
	}
}
//木の根を求める
int root(int x) {
	if (par[x] == x)
		return x;
	else {
		return par[x] = root(par[x]);
	}
}
//find
bool same(int x, int y) {
	return root(x) == root(y);

}
//union
void unite(int x, int y) {
	x = root(x);
	y = root(y);
	if (x == y) return;
	par[x] = y;
}

int main()
{
	long long int N, i, j, k, l, m, ans, sum,flag;
	sum = 0;
	flag = 0;
	char s[100001];
	cin >> s;
	k = strlen(s);
	REP(i, 0, k-1) {
		if (s[i] == s[i + 1]) {
			flag = 1;
			break;
		}
	}
	REP(i, 0, k - 2) {
		if (s[i] == s[i + 2]) {
			flag = 1;
			break;
		}
	}
	if (flag)
		output("No");
	else
		output("Yes");




	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:60:9: error: 'else' without a previous 'if'
   60 |         else
      |         ^~~~
Language: C++

// ConsoleApplication71.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define output(x) cout<<x<<endl;
int par[100001];

void init(int n) {
	for (int i = 0; i < n; i++) {
		par[i] = i;
	}
}
//木の根を求める
int root(int x) {
	if (par[x] == x)
		return x;
	else {
		return par[x] = root(par[x]);
	}
}
//find
bool same(int x, int y) {
	return root(x) == root(y);

}
//union
void unite(int x, int y) {
	x = root(x);
	y = root(y);
	if (x == y) return;
	par[x] = y;
}

int main()
{
	long long int N, i, j, k, l, m, ans, sum,flag;
	sum = 0;
	flag = 0;
	char s[100001];
	cin >> s;
	k = strlen(s);
	REP(i, 0, k-1) {
		if (s[i] == s[i + 1]) {
			flag = 1;
			break;
		}
	}
	REP(i, 0, k - 2) {
		if (s[i] == s[i + 2]) {
			flag = 1;
			break;
		}
	}
	if (flag)
		output("No");
	else
		output("Yes");




	return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:42: error: expected ';' before ')' token
   17 |                 for(int i=0;i<=s.size()-1)
      |                                          ^
      |                                          ;
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <limits.h>

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

Compiler output:
main.c: In function 'main':
main.c:23:22: error: expected ';' before 'return'
   23 |     printf("-1 -1\n")
      |                      ^
      |                      ;
   24 |         return 0 ;
      |         ~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <limits.h>

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

Compiler output:
main.c: In function 'main':
main.c:29:22: error: expected ';' before 'return'
   29 |     printf("-1 -1\n")
      |                      ^
      |                      ;
   30 |         return 0 ;
      |         ~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

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

    for(int i=0:i<n-2;i++)
    {
        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:10:14: error: initializer in range-based 'for' loop
   10 |     for(int i=0:i<n-1;i++)
      |              ^
a.cc:10:19: error: 'n' was not declared in this scope
   10 |     for(int i=0:i<n-1;i++)
      |                   ^
a.cc:10:22: error: expected ')' before ';' token
   10 |     for(int i=0:i<n-1;i++)
      |        ~             ^
      |                      )
a.cc:10:23: error: 'i' was not declared in this scope
   10 |     for(int i=0:i<n-1;i++)
      |                       ^
a.cc:19:14: error: initializer in range-based 'for' loop
   19 |     for(int i=0:i<n-2;i++)
      |              ^
a.cc:19:19: error: 'n' was not declared in this scope
   19 |     for(int i=0:i<n-2;i++)
      |                   ^
a.cc:19:22: error: expected ')' before ';' token
   19 |     for(int i=0:i<n-2;i++)
      |        ~             ^
      |                      )
Language: C++

            #include <iostream>
    #include <string>
            #include <cstdio>
            using namespace std;
            int main()
            {
            char s[100000];
            scanf("%s",s);
            for(int i=0;i+1<s.size();i++)
            {
            if(s[i]==s[i+1])
            {
            printf("%d %d",i+1,i+2);
            return 0;
            }
            if(s[i]==s[i+2]&&i+2<s.size())
            {
            printf("%d %d",i+1,i+3);
            return 0;
            }
            }
            printf("-1 -1");
            	return 0;
            	
            }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: request for member 'size' in 's', which is of non-class type 'char [100000]'
    9 |             for(int i=0;i+1<s.size();i++)
      |                               ^~~~
a.cc:16:36: error: request for member 'size' in 's', which is of non-class type 'char [100000]'
   16 |             if(s[i]==s[i+2]&&i+2<s.size())
      |                                    ^~~~
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
string s;
scanf("%s",s);
for(int i=0;i+1<s.size();i++)
{
if(s[i]==s[i+1])
{
printf("%d %d",i+1,i+2);
return 0;
}
if(s[i]==s[i+2]&&i+2<s.size)
{
printf("%d %d",i+1,i+3);
return 0;
}
}
printf("-1 -1");
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   15 | if(s[i]==s[i+2]&&i+2<s.size)
      |                      ~~^~~~
      |                            ()
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'll' was not declared in this scope
    9 |   for(ll i = 0; i < s.size() - 1; i++){
      |       ^~
a.cc:9:17: error: 'i' was not declared in this scope
    9 |   for(ll i = 0; i < s.size() - 1; i++){
      |                 ^
Language: C++

#include <iostream>

int main() {
     
    std::cout << 1 << " " << 3 << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |     std::cout << 1 << " " << 3 << endl;
      |                                   ^~~~
      |                                   std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#pragma region defins
#define ll long long
#define loop(i,n) for (int i = 0; i < n; i++)
#define loops(i,f,n) for (int i = (f); i < n; i++)
#define INF 100000000000000
#define sort(a) sort(a.begin(),a.end())
#define rsort(a) sort(a.rbegin(),a.rend())
using namespace std;
#pragma endregion
int main()
{
	string s;
	cin >> s;
	if(s.length==1)cout << "-1 -1" << endl;
	else 
	{
	bool ans = false;
	loop(i, s.length() - 2)
	{
		if ((s[i] == s[i + 1] && s[i] != s[i + 2]) || (s[i] == s[i + 2] && s[i] != s[i + 1]) || (s[i + 1] == s[i + 2] && s[i] != s[i + 1]))
		{
			cout << i+1 << " " << i + 3 << endl;
			ans = true;
		}
		if (ans)break;
	}
	if (!ans)cout << "-1 -1" << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   18 |         if(s.length==1)cout << "-1 -1" << endl;
      |            ~~^~~~~~
      |                    ()
Language: C++

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
#define pi acos(-1.0)
using namespace std;

int main() {
	int s = -1, e = -1;
        char str[100000+5]
	scanf("%s", str);
	int len = strlen(str);
	for(int i = 0; str[i]; i++) {
		if(str[i] == str[i + 1]) {
			s = i + 1;
			e = i + 2;
			break;
		} else if(str[i] == str[i + 2]) {
			s = i + 1;
			e = i + 3;
			break;
		}
	}
	cout << s << ' ' << e << '\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before 'scanf'
   11 |         scanf("%s", str);
      |         ^~~~~
a.cc:12:26: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |         int len = strlen(str);
      |                          ^~~
      |                          std
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << s << ' ' << e << '\n';
      |         ^~~~
a.cc:5:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include<math.h>
  +++ |+#include <iostream>
    5 | #define pi acos(-1.0)
Language: C++

#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
int main()
{
    char  s[100100];
    int a[26];
    int f=0,i;
    gets(s);
    int len =strlen(s);
    for(i=2;i<len ;i++)
    {
        if(s[i-2]==s[i-1]||s[i-2]==s[i]||s[i-1]==a[i])
        {
            f=1;
            break;
        }
    }
    if(f==1)
        printf("%d %d\n",i-1,i+1);
    else
        printf("-1 -1\n");
        return 0;
}


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

// 0526.cpp : 定义控制台应用程序的入口点。
//
#define gets(str) gets_s(str)

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <queue>
#define INF 999999
using namespace std;
struct PP
{
	char ch;
	int s, t, num;
}p[130];

bool operator < (PP a, PP b)
{
	return a.num>b.num;
}
int main()
{
	char s[100005];
	gets(s);
	for (int i = 0; i < strlen(s); i++)
	{
		if (p[s[i]].s==0) p[s[i]].s = i;
		p[s[i]].t = i;
		p[s[i]].num++;
	}
	sort(p, p + 128);
	for (int i = 0; i < 26; i++)
	{
		if (p[s[i]].num<2)
		{
			printf("-1 -1\n");
			break;
		}
		if (p[s[i]].num * 2>p[s[i]].t - p[s[i]].s + 1)
		{
			printf("%d %d\n", p[s[i]].s + 1, p[s[i]].t + 1);
			break;
		}
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: 'gets_s' was not declared in this scope; did you mean 'gets'?
    3 | #define gets(str) gets_s(str)
      |                   ^~~~~~
a.cc:26:9: note: in expansion of macro 'gets'
   26 |         gets(s);
      |         ^~~~
Language: C++

// 0526.cpp : 定义控制台应用程序的入口点。
//

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <algorithm>
#include <queue>
#define INF 999999
using namespace std;
struct PP
{
	char ch;
	int s, t, num;
}p[130];

bool operator < (PP a, PP b)
{
	return a.num>b.num;
}
int main()
{
	char s[100005];
	gets(s);
	for (int i = 0; i < strlen(s); i++)
	{
		if (p[s[i]].s==0) p[s[i]].s = i;
		p[s[i]].t = i;
		p[s[i]].num++;
	}
	sort(p, p + 128);
	for (int i = 0; i < 26; i++)
	{
		if (p[s[i]].num<2)
		{
			printf("-1 -1\n");
			break;
		}
		if (p[s[i]].num * 2>p[s[i]].t - p[s[i]].s + 1)
		{
			printf("%d %d\n", p[s[i]].s + 1, p[s[i]].t + 1);
			break;
		}
	}

	return 0;
}

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


#include <cstdio>
#include <algorithm>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

char buf[100000+10];

int main(void) {
  scanf("%s", buf);
  int n = strlen(buf);
  REP(i, n) {
    if(i+1 < n && buf[i] == buf[i+1]) {
      printf("%d %d\n", i+1, i+2);
      return 0;
    } else if(i+2 < n && buf[i] == buf[i+2]) {
      printf("%d %d\n", i+1, i+3);
      return 0;
    }
  }

  puts("-1 -1");
  
  return 0;
}


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

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

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

for(int i = 0 ; i<n ; i++){
int j = i + 1;
int k = i + 2;
if(j < n && str[i] == str[j]){
cout<<i<<" "<<j;
return 0;
}
j = k;
if(j < n && str[i] == str[j]){
cout<<i<<" "<<j;
return 0;
}
cout<<-1<<" "<<-1;
}



















}














Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'n' was not declared in this scope
    9 | for(int i = 0 ; i<n ; i++){
      |                   ^
Language: C++

#include <iostream>

using namespace std;

char s[100000];

int main() {
	cin >> s;
	for (int i = 2; i < strlen(s);i++) {
		//cout << "i:" << i << endl;
		for (int j = 0; j < strlen(s)-i; j++) {
			//cout << "j:" << j << endl;
			int c[('z' - 'a')];
			memset(c, 0, 'z' - 'a');
			for (int k = 0; k <= i; k++) {
				c[s[j + k] - 'a']++;
			}

			for (int k = 0; k < 'z'-'a'; k++) {
				//cout << c[k] << endl;
				if (c[k] > i / 2) {
					cout << j + 1 << " " << j + i + 1 << endl;
					return 0;
				}
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'strlen' was not declared in this scope
    9 |         for (int i = 2; i < strlen(s);i++) {
      |                             ^~~~~~
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 | 
a.cc:14:25: error: 'memset' was not declared in this scope
   14 |                         memset(c, 0, 'z' - 'a');
      |                         ^~~~~~
a.cc:14:25: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <map>
#define ll long long 

using namespace std;

int main(){
	string s;
	cin >> s;
	map<string, int> hash;

	for ( i = 0; i < s.length() -2; ++i)
	{
		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;
		}
		// hash[s[i]]++;
		// if(hash[s[i]] > s.length() / 2 ){
		// 	//unbalanced
		// }
		
	}
	if (s[s.length()-1] == s[s.length()-2])
	{
		cout << s.length() -1 << " " s.length() << endl;
	}

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'i' was not declared in this scope
   16 |         for ( i = 0; i < s.length() -2; ++i)
      |               ^
a.cc:33:45: error: expected ';' before 's'
   33 |                 cout << s.length() -1 << " " s.length() << endl;
      |                                             ^~
      |                                             ;
Language: C++

#include<stdio.h>
2.#include<string.h>
3.int main(){
4.int a;
5.char b[100005];
6.for(int i=0;i<100005;i++){
7.b[i]=0;
8.}
9.scanf("%s",b);
10.a=strlen(b);
11.for(int i=0;i<a-2;i++){
12.if(b[i]==b[i+1]){
13.printf("%d %d",i+1,i+2);
14.return 0;
15.}
16.if(b[i]==b[i+2]){
17.printf("%d %d",i+1,i+3);
18.return 0;
19.}
20.}
21.if(b[a-2]==b[a-1]){
22.printf("%d %d",a-1,a);
23.return 0;
24.}
25. 
26.printf("%d  %d",-1,-1);
27.return 0;
28.}


Compiler output:
a.cc:2:3: error: stray '#' in program
    2 | 2.#include<string.h>
      |   ^
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.#include<string.h>
      | ^~
Language: Java

import java.util.Scanner;

public class Hacking {

	static public String solve(String str){

		
		for(int i = 0; i < str.length(); i++){
			if(i > 0){
				if(str.charAt(i) == str.charAt(i-1))
					return (i) +" " + (i+1);
			}
			if(i > 1){
				if(str.charAt(i) == str.charAt(i-2)){
					return (i-1) + " " + (i+1);
				}
			}
		}
		return "-1 -1";
	}
	
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		String str = scanner.nextLine();

		System.out.println(solve(str));
		
	}

}


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

import java.util.Scanner;

public class Main1 {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		String str = s.next();

		Sub sub = new Sub();

		sub.test(str.length(), str, 'a');
		sub.test(str.length(), str, 'b');
		sub.test(str.length(), str, 'c');
		sub.test(str.length(), str, 'd');
		sub.test(str.length(), str, 'e');
		sub.test(str.length(), str, 'f');
		sub.test(str.length(), str, 'g');
		sub.test(str.length(), str, 'h');
		sub.test(str.length(), str, 'i');
		sub.test(str.length(), str, 'j');
		sub.test(str.length(), str, 'k');
		sub.test(str.length(), str, 'l');
		sub.test(str.length(), str, 'm');
		sub.test(str.length(), str, 'n');
		sub.test(str.length(), str, 'o');
		sub.test(str.length(), str, 'p');
		sub.test(str.length(), str, 'q');
		sub.test(str.length(), str, 'r');
		sub.test(str.length(), str, 's');
		sub.test(str.length(), str, 't');
		sub.test(str.length(), str, 'u');
		sub.test(str.length(), str, 'v');
		sub.test(str.length(), str, 'w');
		sub.test(str.length(), str, 'x');
		sub.test(str.length(), str, 'y');
		sub.test(str.length(), str, 'z');

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

class Sub {
	void test(int strlen, String str, char chr) {
		int count = 0;
		int x = -1;
		int y = -1;
		for (int i = 0; i < strlen; i++) {
			if (str.charAt(i) == chr) {
				if (x == -1) {
					x = i;
					count++;
				} else {
					y = i;
					count++;
					if ((double) count * 2.0 / (y - x) >= 1) {
						x++;
						y++;
						System.out.println(x+ " " + y);
						System.exit(1);
					}
				}
			}
		}
	}
}

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

import java.util.Scanner;

public class Main1 {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		String str = s.next();

		Sub sub = new Sub();

		sub.test(str.length(), str, 'a');
		sub.test(str.length(), str, 'b');
		sub.test(str.length(), str, 'c');
		sub.test(str.length(), str, 'd');
		sub.test(str.length(), str, 'e');
		sub.test(str.length(), str, 'f');
		sub.test(str.length(), str, 'g');
		sub.test(str.length(), str, 'h');
		sub.test(str.length(), str, 'i');
		sub.test(str.length(), str, 'j');
		sub.test(str.length(), str, 'k');
		sub.test(str.length(), str, 'l');
		sub.test(str.length(), str, 'm');
		sub.test(str.length(), str, 'n');
		sub.test(str.length(), str, 'o');
		sub.test(str.length(), str, 'p');
		sub.test(str.length(), str, 'q');
		sub.test(str.length(), str, 'r');
		sub.test(str.length(), str, 's');
		sub.test(str.length(), str, 't');
		sub.test(str.length(), str, 'u');
		sub.test(str.length(), str, 'v');
		sub.test(str.length(), str, 'w');
		sub.test(str.length(), str, 'x');
		sub.test(str.length(), str, 'y');
		sub.test(str.length(), str, 'z');

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

class Sub {
	void test(int strlen, String str, char chr) {
		int count = 0;
		int x = -1;
		int y = -1;
		for (int i = 0; i < strlen; i++) {
			if (str.charAt(i) == chr) {
				if (x == -1) {
					x = i;
					count++;
				} else {
					y = i;
					count++;
					if ((double) count * 2.0 / (y - x) >= 1) {
						System.out.println((x+1) + " " + (y+1));
						System.exit(1);
					}
				}
			}
		}
	}
}

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

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
using namespace std;
string s;

void solve(){
    if(s.size==2){
        if(s[0]==s[1])printf("1 2\n");
        return;
    }
    for(int i=0;i<s.size()-2;i++){
        if(s[i]==s[i+1]||s[i]==s[i+2]){
            printf("%d %d\n",i+1,i+3);
            return;
        }
    }
    printf("-1 -1\n");
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:8:10: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |     if(s.size==2){
      |        ~~^~~~
      |              ()
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
using namespace std;
string s;

void solve(){
    for(int i=0;i<s.size()-2;i++){
        if(s[i]==s[i+1]||s[i]==s[i+2]]){
            printf("%d %d\n",i+1,i+3);
            return;
        }
    }
    printf("-1 -1\n");
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:9:38: error: expected ')' before ']' token
    9 |         if(s[i]==s[i+1]||s[i]==s[i+2]]){
      |           ~                          ^
      |                                      )
a.cc:9:38: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
using namespace std;
string s;

void solve(){
    for(int i=0;i<s.size()-2;i++){
        if(s[i]==s[i+1||s[i]==s[i+2]]){
            printf("%d %d\n"i+1,i+3);
            return;
        }
    }
    printf("-1 -1\n");
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:10:20: error: unable to find string literal operator 'operator""i' with 'const char [7]', 'long unsigned int' arguments
   10 |             printf("%d %d\n"i+1,i+3);
      |                    ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
using namespace std;
string s;

void solve(){
    for(int i=0;i<s.size()-2;i++){
        if(s[i]==s[i+1||s[i]==s[i+2]]{
            printf("%d %d\n"i+1,i+3);
            return;
        }
    }
    printf("-1 -1\n");
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:9:38: error: expected ')' before '{' token
    9 |         if(s[i]==s[i+1||s[i]==s[i+2]]{
      |           ~                          ^
      |                                      )
a.cc:13:5: error: expected primary-expression before '}' token
   13 |     }
      |     ^
Language: C++

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

int main() {
  string a;
  vector<int> b;
  cin >> a;
  for(int i = 2; i < a.length(); i++) {
    if(a[i - 2] == a[i - 1] || a[i - 2] == a[i] || a[i - 1] == a[i]) {
      cout << i - 1 << " " << i + 1 << endl;
      return;
    }
  }
  cout << -1 << " " << -1 << endl;
}

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

#include <iostream>
using namespace std;

int main() {
  string s
  cin >> s;
  if (s.length() > 2) {
    for (int i; 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;
      }
    }
  } else {
    cout << "-1 -1" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> s;
      |   ^~~
a.cc:7:7: error: 's' was not declared in this scope
    7 |   if (s.length() > 2) {
      |       ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 10e15+9
#define MOD 1000000007
#define EPS 1e-10
#define MAX_N 100100
#define MAX_M 100100

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

string s;
int ans = -1;

int main(){
	cin >> s;
	if (s.size() == 2){
		if (s[0] == s[1])cout << 1 << " " << 2 << endl;
		else cout << -1 << " " << -1 << endl;
		return;
	}
	REP(i, s.size() - 2){
		if (s[i] == s[i + 1] || s[i] == s[i + 2] || s[i + 1] == s[i + 2]){
			ans = i + 1;
			break;
		}
	}
	if (ans == -1){
		cout << ans << " " << ans << endl;
	}
	else{
		cout << ans << " " << ans + 2 << endl;
	}
}

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

#include <stdio.h>
#include <bitset>
#include <string.h>
#include <stack>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <math.h>
#include <queue>
#include <complex>
#include <functional>
using namespace std ;
typedef long long ll ;
typedef long double ld ;
typedef unsigned long long ull ;
#ifdef _WIN32
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define pi (acos(-1.0))
#define fi first
#define se second
#define lson (o<<1),l,mid
#define rson (o<<1|1),mid+1,r
#define MP make_pair
#define sqr(x) ((x)*(x))
#define ALL(v) (v).begin(),(v).end()
#define showtime fprintf(stderr,"time = %.15f\n",clock() / (double)CLOCKS_PER_SEC)
const double eps = 1e-9 ;
const int inf = 0x3f3f3f3f ;
const ll INF = (ll)4e18 ;
const int MOD=(int)1e9+7,BAS=257,invBAS=70038911;
inline int sign(double x){return x<-eps?-1:x>eps;}
inline int clz(int x){return __builtin_clz(x);}
inline int clz(ll x){return __builtin_clzll(x);}
inline int lg2(int x){return !x ? -1 : 31-clz(x);}
inline int lg2(ll x){return !x ? -1 : 63-clz(x);}

char s[100000+10];
int main () {
	scanf ("%s", s+1);
	n = strlen (s+1)+1;
	if (n == 3) {
		if (s[1] == s[2]) printf ("1 2\n");
		exit(0);
	} else {
		for (int i=1; i+1<n; i++)
			if (s[i]==s[i+1]||s[i]==s[i+2]||s[i+1]==s[i+2]) {
				printf("%d %d\n", i, i==n-2?i+1:i+2); exit(0);
			}
	}
	puts ("-1 -1");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'n' was not declared in this scope; did you mean 'yn'?
   44 |         n = strlen (s+1)+1;
      |         ^
      |         yn
Language: Java

/* Filename: ARC059D.java
 * Author: Mushiyo
 */

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

public class ARC059D {

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

		while (input.hasNext()) {
			String s = input.next();
			int[] countChar = new int[26];
			int[] countPrevFreq = new int[s.length()];

			for (int i = 0; i < s.length(); ++i) {
				++countChar[s.charAt(i) - 'a'];
				countPrevFreq[i] = countChar[s.charAt(i) - 'a'];
			}

			boolean isUnbalanced = false;
			for (int i = 0; i < s.length() - 1 && isUnbalanced == false; ++i) {
				for (int j = i + 1; j < s.length(); ++j) {
					if (s.charAt(i) == s.charAt(j)) {
						int len = j - i + 1;
						int freqDiff = countPrevFreq[j] - countPrevFreq[i] + 1;

						if (freqDiff * 2 > len) {
							System.out.printf("%d %d\n", i + 1, j + 1);
							isUnbalanced = true;
							break;
						}
					}
				}
			}

			if (isUnbalanced == false) {
				System.out.println("-1 -1");
			}

		}
	}
}


Compiler output:
Main.java:8: error: class ARC059D is public, should be declared in a file named ARC059D.java
public class ARC059D {
       ^
1 error