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

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

// 条件を満たすような分割が出来る=>2部グラフになっている
// もし2部グラフでないなら、分割不可。2部グラフならグラフの直径+1が最大分割数となる
int main() {
    int n;
    cin >> n;
    vector<vector<int>> s(n, vector<int>(n));
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
          #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;  char c;
          
            cin >> c;
            if (c == '0') s[i][j] = INF;
            else s[i][j] = 1;
        }
    }

    for (int k = 0; k < s.size(); k++) {
        for (int i = 0; i < s.size(); i++) {
            for (int j = 0; j < s.size(); j++) {
                if (s[i][k] == INF || s[k][j] == INF)
                    continue;
                s[i][j] = min(s[i][j], s[i][k] + s[k][j]);
            }
        }
    }

    set<vector<int>> sv;
    int diam = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i != j)
                diam = max(s[i][j], diam);
            s[i][j] = s[i][j] % 2;
        }
        sv.insert(s[i]);
    }

    int k;
    if (sv.size() != 2) k = -1;
    else k = diam + 1;
    cout << k << endl;
    return 0;
}


Compiler output:
a.cc:5:1: error: 'INF' does not name a type
    5 | INF = 1000000
      | ^~~
Language: C++

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

// 条件を満たすような分割が出来る=>2部グラフになっている
// もし2部グラフでないなら、分割不可。2部グラフならグラフの直径+1が最大分割数となる
int main() {
    int n;
    cin >> n;
    vector<vector<int>> s(n, vector<int>(n));
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
          #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;  char c;
          
            cin >> c;
            if (c == '0') s[i][j] = INF;
            else s[i][j] = 1;
        }
    }

    for (int k = 0; k < s.size(); k++) {
        for (int i = 0; i < s.size(); i++) {
            for (int j = 0; j < s.size(); j++) {
                if (s[i][k] == INF || s[k][j] == INF)
                    continue;
                s[i][j] = min(s[i][j], s[i][k] + s[k][j]);
            }
        }
    }

    set<vector<int>> sv;
    int diam = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i != j)
                diam = max(s[i][j], diam);
            s[i][j] = s[i][j] % 2;
        }
        sv.insert(s[i]);
    }

    int k;
    if (sv.size() != 2) k = -1;
    else k = diam + 1;
    cout << k << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: 'INF' was not declared in this scope
   20 |             if (c == '0') s[i][j] = INF;
      |                                     ^~~
a.cc:28:32: error: 'INF' was not declared in this scope
   28 |                 if (s[i][k] == INF || s[k][j] == INF)
      |                                ^~~
Language: C++

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

short int main(){
    short int N;
    cin >> N;
    short int S[N][N];
    for(short int i=0; i<N; i++){
        string s;
        cin >>s;
        for(short int j = 0;j <N; j++){
            S[i][j] = (s[j] == '1');
        }
    }

    short int ans = -1;

    for(short int i =0; i<N; i++){
        queue<pair<short int, short int > > q;
        short int r[N]; for(short int j=0; j<N; j++) r[j] = 201;
        bool used[N]; for(short int j =0 ; j<N;j++) used[j] =false;


        q.push({i, 1});
        bool ok = true;
        short int rk;

        while(!q.empty()){
            auto v = q.front(); q.pop();
            short int vn = v.first;
            rk = v.second;
            used[vn] = true;
            for(short int j =0; j<N; j++){
                if(S[vn][j] == 1){
                    if(r[j] == rk){
                        ok = false;
                        break;
                    }
                    else if(!used[j]){
                        q.push({j, rk + 1});
                        r[j] = rk + 1;
                        //cout << rk << endl;
                    }
                }
            }
            if(!ok) break;
        }

        if(ok) ans = max(ans, rk);
        else break;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:6:7: error: '::main' must return 'int'
    6 | short int main(){
      |       ^~~
Language: C++

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

int main(){
    short int N;
    cin >> N;
    int S[N][N];
    for(short int i=0; i<N; i++){
        string s;
        cin >>s;
        for(short int j = 0;j <N; j++){
            S[i][j] = (s[j] == '1');
        }
    }

    int ans = -1;

    for(short int i =0; i<N; i++){
        queue<pair<short int, short int > > q;
        short int r[N]; for(int j=0; j<N; j++) r[j] = 201;
        bool used[N]; for(int j =0 ; j<N;j++) used[j] =false;


        q.push({i, 1});
        bool ok = true;
        short int ra;

        while(!q.empty()){
            auto v = q.front(); q.pop();
            int vn = v.first;
            ra = v.second;
            used[vn] = true;
            for(short int j =0; j<N; j++){
                if(S[vn][j] == 1){
                    if(r[j] == ra){
                        ok = false;
                        break;
                    }
                    else if(!used[j]){
                        q.push({j, ra + 1});
                        r[j] = ra + 1;
                        //cout << ra << endl;
                    }
                }
            }
            if(!ok) break;
        }

        if(ok) ans = max(ans, ra);
        else break;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:25: error: no matching function for call to 'max(int&, short int&)'
   51 |         if(ok) ans = max(ans, ra);
      |                      ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:51:25: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'short int')
   51 |         if(ok) ans = max(ans, ra);
      |                      ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int N;
char str[MAX];
int color[MAX];
int graph[MAX][MAX];
int depth[2][MAX];

int bfs(int cur)
{
	queue<int> q;
	q.push(cur);
	color[cur] = 0;
	depth[cur] = 0;
	int ret = 0;
	while (!q.empty())
	{
		cur = q.front();
		q.pop();
		for (int i = 0; i < N; i++)
		{
			if (graph[cur][i])
			{
				if (color[i] == color[cur])
				{
					cout << -1 << endl;
					exit(0);
				}
				if (color[i] < 0)
				{
					q.push(i);
					color[i] = !color[cur];
					depth[i] = depth[cur] + 1;
					ret = depth[i];
				}
			}
		}
	}
	return ret;
}

int main(void)
{
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> str;
		for (int j = 0; j < N; j++) graph[i][j] = str[j] - '0';
	}
	int mmax = -1;
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < N; j++)
		{
			depth[j] = -1;
			color[j] = -1;
		}
		mmax = max(mmax, bfs(i));
	}
	cout << mmax + 1 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int bfs(int)':
a.cc:16:20: error: incompatible types in assignment of 'int' to 'int [234]'
   16 |         depth[cur] = 0;
      |         ~~~~~~~~~~~^~~
a.cc:35:50: error: incompatible types in assignment of 'int*' to 'int [234]'
   35 |                                         depth[i] = depth[cur] + 1;
      |                                         ~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:36:54: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   36 |                                         ret = depth[i];
      |                                               ~~~~~~~^
      |                                                      |
      |                                                      int*
a.cc: In function 'int main()':
a.cc:57:34: error: incompatible types in assignment of 'int' to 'int [234]'
   57 |                         depth[j] = -1;
      |                         ~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
ll n,m,ans=-100;
int s[200][200];
const ll MOD = 1000000007;
bool bfs(int s[][],int t,vector<ll> &group){
    queue<int> q;
    group.at(t)=1;
    q.push(t);
    while(!q.empty()){
        int i=q.front();
        int nowdist=group.at(i);
        q.pop();
        For(j,0,n){
            if(s.at(i).at(j)==1){
                if(group.at(j)==nowdist){
                    return false;
                }
                if(group.at(j)==0){
                    q.push(j);
                    if(group.at(j)==nowdist){
                        return false;
                    }
                    group.at(j)=group.at(i)+1;
                }
            }
        }
    }
    return true;
}

ll count(ll t){
    vector<ll> group(n,0);
    bool flag=bfs(s,t,group);
    if(!flag) return -1;
    ll kazu=-1;
    For(i,0,n){
        kazu=max(kazu,group.at(i));
    }
    return kazu;
}
void Main(){    
    cin>>n;
    For(i,0,n){
        string x;cin>>x;
        For(j,0,n){
            s[i][j]=x.at(j)-'0';
        }
    }
    For(t,0,n){
        ll cnt=count(t);
        ans=max(ans,cnt);
    }
    cout<<ans<<endl;
}
int main(){
    Main();
    return 0;
}


Compiler output:
a.cc:8:14: error: declaration of 's' as multidimensional array must have bounds for all dimensions except the first
    8 | bool bfs(int s[][],int t,vector<ll> &group){
      |              ^
a.cc:8:19: error: expected ')' before ',' token
    8 | bool bfs(int s[][],int t,vector<ll> &group){
      |         ~         ^
      |                   )
a.cc:8:20: error: expected unqualified-id before 'int'
    8 | bool bfs(int s[][],int t,vector<ll> &group){
      |                    ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
ll n,m,ans=-100;
int s[200][200];
const ll MOD = 1000000007;
bool bfs(int t,vector<ll> &group,int s[][]){
    queue<int> q;
    group.at(t)=1;
    q.push(t);
    while(!q.empty()){
        int i=q.front();
        int nowdist=group.at(i);
        q.pop();
        For(j,0,n){
            if(s.at(i).at(j)==1){
                if(group.at(j)==nowdist){
                    return false;
                }
                if(group.at(j)==0){
                    q.push(j);
                    if(group.at(j)==nowdist){
                        return false;
                    }
                    group.at(j)=group.at(i)+1;
                }
            }
        }
    }
    return true;
}

ll count(ll t){
    vector<ll> group(n,0);
    bool flag=bfs(t,group,s);
    if(!flag) return -1;
    ll kazu=-1;
    For(i,0,n){
        kazu=max(kazu,group.at(i));
    }
    return kazu;
}
void Main(){    
    cin>>n;
    For(i,0,n){
        string x;cin>>x;
        For(j,0,n){
            s[i][j]=x.at(j)-'0';
        }
    }
    For(t,0,n){
        ll cnt=count(t);
        ans=max(ans,cnt);
    }
    cout<<ans<<endl;
}
int main(){
    Main();
    return 0;
}


Compiler output:
a.cc:8:38: error: declaration of 's' as multidimensional array must have bounds for all dimensions except the first
    8 | bool bfs(int t,vector<ll> &group,int s[][]){
      |                                      ^
a.cc: In function 'bool bfs(...)':
a.cc:10:5: error: 'group' was not declared in this scope
   10 |     group.at(t)=1;
      |     ^~~~~
a.cc:10:14: error: 't' was not declared in this scope
   10 |     group.at(t)=1;
      |              ^
a.cc:17:18: error: request for member 'at' in 's', which is of non-class type 'int [200][200]'
   17 |             if(s.at(i).at(j)==1){
      |                  ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
ll n,m,ans=-100;
int s[200][200];
const ll MOD = 1000000007;
bool bfs(int t,vector<ll> &group,vector<vector<int>> s){
    queue<int> q;
    group.at(t)=1;
    q.push(t);
    while(!q.empty()){
        int i=q.front();
        int nowdist=group.at(i);
        q.pop();
        For(j,0,n){
            if(s.at(i).at(j)==1){
                if(group.at(j)==nowdist){
                    return false;
                }
                if(group.at(j)==0){
                    q.push(j);
                    if(group.at(j)==nowdist){
                        return false;
                    }
                    group.at(j)=group.at(i)+1;
                }
            }
        }
    }
    return true;
}

ll count(ll t){
    vector<ll> group(n,0);
    bool flag=bfs(t,group,s);
    if(!flag) return -1;
    ll kazu=-1;
    For(i,0,n){
        kazu=max(kazu,group.at(i));
    }
    return kazu;
}
void Main(){    
    cin>>n;
    For(i,0,n){
        string x;cin>>x;
        For(j,0,n){
            s[i][j]=x.at(j)-'0';
        }
    }
    For(t,0,n){
        ll cnt=count(t);
        ans=max(ans,cnt);
    }
    cout<<ans<<endl;
}
int main(){
    Main();
    return 0;
}


Compiler output:
a.cc: In function 'll count(ll)':
a.cc:36:27: error: could not convert '(int (*)[200])(& s)' from 'int (*)[200]' to 'std::vector<std::vector<int> >'
   36 |     bool flag=bfs(t,group,s);
      |                           ^
      |                           |
      |                           int (*)[200]
Language: C++

#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

vector<int> mark;

bool nibu(const vector<vector<int>> &G, int v, int p, int m) {
    if (mark[v] != -1) {
        if (mark[v] == m) return true;
        return false;
    }
    mark[v] = m;
    for (int u : G[v]) {
        if (u == p) continue;
        if (!nibu(G, u, v, 1 - m)) return false;
    }
    return true;
}

int bfs(const vector<vector< int>> &G, int s) {
    int n = G.size();
    vector<bool> visited(n, false);
    queue<pair<int, int>> que; // 頂点,深さ
    que.push({s,1});
    visited[s] = true;
    int res = 0;
    while (!que.empty()) {
        pair<int, int> p = que.front(); que.pop();
        res = max(res, p.second);
        for (int v : G[p.first]) {
            if (visited[v]) continue;
            visited[v] = true;
            que.push({v,p.second + 1});
        }
    }
    return res;
}

int main() {
    int n; cin >> n;
    mark = vector<int>(n, -1);
    vector<vector<int>> G(n);
    vector<string> g(n);
    REP(i, n) cin >> g[i];
    REP(i, n) {
        FOR(j, i + 1, n) {
            if (g[i][j] == '1') {
                G[i].push_back(j);
                G[j].push_back(i);
            }
        }
    }
    if (!nibu(G)) {
        puts("-1");
        return 0;
    }
    int ans = 0;
    REP(i, n) {
        ans = max(ans, bfs(G, i));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:14: error: too few arguments to function 'bool nibu(const std::vector<std::vector<int> >&, int, int, int)'
   57 |     if (!nibu(G)) {
      |          ~~~~^~~
a.cc:11:6: note: declared here
   11 | bool nibu(const vector<vector<int>> &G, int v, int p, int m) {
      |      ^~~~
Language: C++


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>

using namespace std;

using Graph = vector<vector<int> >;

vector<int> seen;

void main()
{
	int N;

	cin >> N;

	vector<string> S(N);

	for (int ni = 0; ni < N; ni++){
		cin >> S[ni];
	}

	int min_i = 0;
	int max_i = 0;

	vector<int> color(N,0);

	int c;
	color[0] = 1;
	for(int li = 0; li < N; li++){
		c = color[li];
		for(int ri = 0; ri < N; ri++){
			if (S[li][ri] == '1'){
				if (color[ri] == 0) {
					color[ri] = c + 1;
					max_i = max(max_i, c + 1);
				}
				else {
					if (color[ri] != c - 1 && color[ri] != c + 1) {
						std::cout << -1;
						return;
					}
				}
			}
		}
	}


	int cnt_l = 0;
	int li = 2;
	int flag = 1;
	int cnt_2 = 0;
	for (int li = 0; li < N; li++) {
		if (color[li] == 2) {
			cnt_2++;
			flag = 1;
			for (int ri = 0; ri < N; ri++) {
				if (S[li][ri] == '1' && color[ri] > 2) {
					flag = 0;
				}
			}
			if (flag == 1) {
				cnt_l = 1;
			}
		}
	}

	if (cnt_2 == 1) cnt_l = 0;

	int ans = max_i + cnt_l;
	//printf("%.9f", ans);
	std::cout << ans;

	return;
}



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

#include "stdafx.h"

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>

using namespace std;

using Graph = vector<vector<int> >;

vector<int> seen;

void main()
{
	int N;

	cin >> N;

	vector<string> S(N);

	for (int ni = 0; ni < N; ni++){
		cin >> S[ni];
	}

	int min_i = 0;
	int max_i = 0;

	vector<int> color(N,0);

	int c;
	color[0] = 1;
	for(int li = 0; li < N; li++){
		c = color[li];
		for(int ri = 0; ri < N; ri++){
			if (S[li][ri] == '1'){
				if (color[ri] == 0) {
					color[ri] = c + 1;
					max_i = max(max_i, c + 1);
				}
				else {
					if (color[ri] != c - 1 && color[ri] != c + 1) {
						std::cout << -1;
						return;
					}
				}
			}
		}
	}


	int cnt_l = 0;
	int li = 2;
	int flag = 1;
	int cnt_2 = 0;
	for (int li = 0; li < N; li++) {
		if (color[li] == 2) {
			cnt_2++;
			flag = 1;
			for (int ri = 0; ri < N; ri++) {
				if (S[li][ri] == '1' && color[ri] > 2) {
					flag = 0;
				}
			}
			if (flag == 1) {
				cnt_l = 1;
			}
		}
	}

	if (cnt_2 == 1) cnt_l = 0;

	int ans = max_i + cnt_l;
	//printf("%.9f", ans);
	std::cout << ans;

	return;
}



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

import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());

		// graph list
		ArrayList<ArrayList<Integer>> edge = new ArrayList<ArrayList<Integer>>();
		for (int i=0;i<N;i++) {
			ArrayList<Integer> add = new ArrayList<Integer>();
			edge.add(add);
		}

		//graph matrix
		char[][] graph = new char[N][N];
		for (int i=0;i<N;i++) {
			String S = sc.next();
			for (int j=0;j<N;j++) {
				char flag = S.charAt(j);
				graph[i][j] = flag;

				// graph list add
				if (flag=='1') {
					edge.get(i).add(j);
				}
			}
		}
		int flag = 0;
		int tmp_depth = 0;

		// loop:for (int j=0;j<N;j++) {
		int j=0;
			int[] used = new int[N];
			for (int i=0;i<N;i++) {
				used[i] = -1;
			}
			int root = j;
			ArrayDeque<int[]> queue = new ArrayDeque<int[]>();
			int[] add = {root, 0};
			queue.add(add);
			while (!queue.isEmpty()) {
				int[] rem = queue.remove();int index = rem[0];int depth = rem[1];
				// System.out.println("rem : " + Arrays.toString(rem));
				tmp_depth = Math.max(tmp_depth, depth);
				used[index] = depth;
				ArrayList<Integer> edge_list = edge.get(index);
				for (Integer i : edge_list) {
					if (used[i]==-1) {
						int[] add_q = {i, depth+1};
						queue.add(add_q);
					} else if (used[i]!=depth-1) {
						flag=1;
						break loop;
					}
				}
			}
		// }
		if (flag==1) {
			System.out.println(-1);
		} else {
			System.out.println(tmp_depth+1);
		}

		// for (ArrayList<Integer> aaa : edge) {
			// System.out.println(aaa);
		// }
		// System.out.println("used " + Arrays.toString(used));
	}
}

Compiler output:
Main.java:54: error: undefined label: loop
						break loop;
						^
1 error
Language: C++

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

#define f first
#define s second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define sz(x) (int)x.size()
#define sqr(x) ((x) * 1ll * (x))
#define all(x) x.begin(), x.end()
#define clr(a,v) memset(a, v, sizeof(a))

#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, l, r) for (int i = (l); i >= (r); i--)
#define reflex ios_base::sync_with_stdio(false)

#define nl '\n'
#define ioi exit(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int N= (int)2e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
//const int mod = 1000000007;
const ll linf = (ll)1e18 + 7;

const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int kx[] = {-1,1,2,2,1,-1,-2,-2};
const int ky[] = {2,2,1,-1,-2,-2,-1,1};


struct point{
	int x, y;
	point(){
		x = 0;
		y = 0;
	}
	point(int x, int y){
		this->x = x;
		this->y = y;
	}
	bool operator < (const point& p) const{
		if(p.x == this->x){
			return p.y > this->y;
		}
		else{
			return p.x > this->x;
		}
	}
	
};

int prod(point & a, point & b){
	return a.x*b.y - a.y*b.x;
}




int pi[202], d[202];
bool vis[202];
vector<int> g[210];

void add(int i, int j){
	g[i].push_back(j);
	g[j].push_back(i);
}
int bfs(int i){
	clr(vis,false);
	clr(pi,0);
	clr(d,0);

	int source = i;
	queue<int> q;
	q.push(source);
	int maxi = 0;
	while(!q.empty()){
		int x = q.front();
		q.pop();
		
		vis[x] = true;
		for(int k = 0; k <= (int)g[x].size()-1; k++){
			int u = g[x][k];
			if(!vis[u]){
				q.push(u);
				pi[u] = x;
				d[u] = d[x] + 1;
				maxi = max(maxi,d[u]);
			}
			else{
				
					if( abs(d[u] - d[x]) < 1 || abs(d[u] - d[x]) > 1){
						return -1;
					}
				
			}
		}
	}
	return maxi;
}

int main(){
	int n; cin>> n;
	char x;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			cin>> x;
			if(x == '1'){
				add(i,j);
			}
		}
	}
	int ans = -1;
	
		ans = max(ans, bfs(i));
	
	if(ans == -1)
		cout<<-1;
	else
		cout<<ans+1;
	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:126:36: error: 'i' was not declared in this scope
  126 |                 ans = max(ans, bfs(i));
      |                                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n;cin>>n;

    string s[n];
    rep(i,n){
        cin>>s[i];
    }

    int g[n][n];
    rep(i,n){
        rep(j,n){
            if(s[i][j]=='1'){
                g[i][j]=1;
            }
            else{
                g[i][j]=INF;
            }
        }
    }

    rep(k,n){rep(i,n){rep(j,n){
        g[i][j]=min(g[i][j],g[i][k]+g[k][j]);
    }}}
ll ans=-1;
    rep(i,n){
        map<int,int> mp;
        mp[i]=0;
        rep(j,n){
            if(i==j) continue;
            mp[j]=g[i][j];
        }
        ll ret=-1;
        rep(i,n){
            bool f=true;
            for(int j=i+1;j<n;j++){
                if(s[i][j]=='1'){
                    if(abs(mp[i]-mp[j])!=1){
                        f=false;
                    }
                }
            }
        }
        rep(i,n)if(i!=j)ret=max(ret,g[i][j]);
        if(f) ans=max(ret,ans);
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:23: error: 'j' was not declared in this scope
   60 |         rep(i,n)if(i!=j)ret=max(ret,g[i][j]);
      |                       ^
a.cc:61:12: error: 'f' was not declared in this scope
   61 |         if(f) ans=max(ret,ans);
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <bits/stdc++.h> 

using namespace std;

int n;
int setCount;

int main (){
    setCount = 0;
    cin >> n;
    bool visited[n];
    int a[n][n];
    for(int i = 0; i < n; i++){
        visited[n] = false;
        for(int j = 0; j < n; j++){
            cin >> a[i][j];
        }
    }
    queue <int> q;
    for(int i = 0; i < n; i++){
        if(!visited[i]){
            int recent = -1;
            q.push(0);
            while(!q.empty()){
            int current = q.front();
            q.pop();
            for(int i = 0; i < n; i++){
                if(a[current][i] == 1){
                    if(!visited[i]){
                        q.push[i];
                        visited[i] = true;
                    }
                }
                setCount++;
                recent = current;
            }
        }
    }
    if(setCount == 1){
        cout << -1 << endl;
        return 0;
    }
    else{
        cout << setCount;
        return 0;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   32 |                         q.push[i];
      |                               ^
a.cc:49:2: error: expected '}' at end of input
   49 | }
      |  ^
a.cc:10:12: note: to match this '{'
   10 | int main (){
      |            ^
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int n=Integer.parseInt(sc.next());
        int[][] s=new int[n][n];
        int[][] edges=new int[n];
        int edge=0;
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                s[i][j]=Integer.parseInt(sc.next());
                if(s[i][j]==1){
                    edge++;
                }
            }
            edges[i]=edge;
            edge=0;
        }
        int[] color=new int[n];
        Arrays.fill(color,-1);
        color[0]=0;
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                if(s[i][j]==1){
                    if(color[i]==0){
                        if(color[j]==-1){
                            color[j]=1;
                        }
                        else if(color[j]==0){
                            System.out.println("-1");
                            System.exit(0);
                        }
                    }
                    else if(color[i]==1){
                        if(color[j]==-1){
                            color[j]=0;
                        }
                        else if(color[j]==1){
                            System.out.println("-1");
                            System.exit(0);
                        }
                    }
                }
            }
        }

        for(int i=0;i<n;i++){
            if(color[i]==0){
                
            }
        }
    }
}

Compiler output:
Main.java:8: error: incompatible types: int[] cannot be converted to int[][]
        int[][] edges=new int[n];
                      ^
Main.java:17: error: incompatible types: int cannot be converted to int[]
            edges[i]=edge;
                     ^
2 errors
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=(n)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define maxs(a,b) a=max(a,b);
#define mins(a,b) a=min(a,b);
#define max3(a,b,c) max(a,max(b,c)) 
#define mix3(a,b,c) mix(a,mix(b,c))
#define pairi pair<int,int>

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;

int main(){
   
    int n;cin>>n;
    vector<string> s(n+1 "0");
    string stmp;
    repa(1,n+1){
        cin>>stmp;
        s[i]+=stmp;
    }

    vi v(n+1,-1);
    queue<int> que;
    vi checked(n+1,0);
    v[1]=0;
    que.push(1);
    checked[1]=1;
    int a;
    while(!que.empty()){
        a=que.front();que.pop();
        repa(i,a,n+1){
            if(s[a][i]==1){
                if(checked[i]!=1){
                    v[i] = v[a]^1;
                    checked[i]=1;
                    que.push(i);
                }else{
                    if(v[a]^v[i]==0){
                        cout<<-1<<endl;
                        return 0;
                    }
                }
            }
        }
    }

    int l=0;r=1;

    repa(i,1,n+1){
        
    }

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

Compiler output:
a.cc:30:15: error: macro "repa" requires 3 arguments, but only 2 given
   30 |     repa(1,n+1){
      |               ^
a.cc:6:9: note: macro "repa" defined here
    6 | #define repa(i,a,n) for(int i=(a);i<(n);i++)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:28:25: error: expected ')' before string constant
   28 |     vector<string> s(n+1 "0");
      |                     ~   ^~~~
      |                         )
a.cc:30:5: error: 'repa' was not declared in this scope
   30 |     repa(1,n+1){
      |     ^~~~
a.cc:60:13: error: 'r' was not declared in this scope
   60 |     int l=0;r=1;
      |             ^
a.cc:66:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   66 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

int main() {
  cout << -1 << "\n;
  return 0;
}

Compiler output:
a.cc:7:17: warning: missing terminating " character
    7 |   cout << -1 << "\n;
      |                 ^
a.cc:7:17: error: missing terminating " character
    7 |   cout << -1 << "\n;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: expected primary-expression before 'return'
    8 |   return 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespase std;
int main(){
  cout<<-1<<endl;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
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<<-1<<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:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 |   cout<<-1<<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 <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 1000000007;
const int INF = LLONG_MAX/3;
int v;
int d[200][200];
void warshall_floyd(){
    for(int k=0;k<v;k++){
        for(int i=0;i<v;i++){
            for(int j=0;j<v;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
        }
    }
}
signed main(){
    cin>>v;
    for(int i=0;i<v;i++){
        for(int j=0;j<v;j++){
            char a;
            cin>>a;
            if(i==j)d[i][j]=0;
            else if(a=='1')d[i][j]=1;
            else d[i][j]=INF;
        }
    }
    warshall_floyd();
    bool able=true;
    for(int i=0;i<v;i++){
        for(int j=i+1;j<v;j++){
            int c=INF;
            for(int k=0;k<v;k++){
                if(k==i||k==j)continue;
                c=min(d[i][k]+d[k][j]+d[i][j],c);
            }
            if(c%2==1&&c!=INF){
                able=false;
                break;
            }
        }
    }
    if(able==false){
        cout<<-1<<endl;
    }
    else{
        int ans=0;
        for(int i=0;i<v;i++){
            for(int j=0;j<v;j++){
                ans=max(ans,d[i][j]);
            }
        }
        cout<<ans+1<<endl;
    }
    return 0;
}


Compiler output:
a.cc:21:17: error: 'LLONG_MAX' was not declared in this scope
   21 | const int INF = LLONG_MAX/3;
      |                 ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <unordered_map>
  +++ |+#include <climits>
   15 | #define int long long
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef pair<int,int> P;
#pragma GCC optimize("Ofast")

const int MAX_N = 205;

int N;
char G1[MAX_N][MAX_N];
vector<vector<int>> G;

int bfs(int v){
    
    vector<bool> used(N,0);
    vector<int> id(N, -10);

    queue<P> Q;
    Q.push({v,1});
    while(!Q.empty()){
        auto now = Q.front();Q.pop();
        int vn = now.first;
        int group = now.second;
        if(used[vn]) return -1;
        id[vn] = group;
        //cout << vn << endl;
        if(used[])

        for(auto next: G[vn]){
            if(id[next] == group - 1 ) continue;
            if(used[next] && id[next] < group - 1) return -1;
            Q.push({next, group + 1});
        }
        used[v] = true;
    }
    //cout << "yes\n";
    int ans = -1;
    rep(i,N) ans = max(ans, id[i]);
    return ans;
}
int BipartiteGraph(const vector<vector<int>> &g) {
        int n = g.size();
        vector<int> color(n, -1);
        int white_cnt = 0;
        function<bool (int, int, int)> dfs = [&](int u, int prev, int c) {
                color[u] = c;
                if (c == 1) white_cnt ++;
                for (auto v : g[u]) if (v != prev) {
                        if (color[v] == -1) {
                                if (!dfs(v, u, 1 - c)) return false;
                        } else if (color[v] != 1 - c) {
                                return false;
                        }
                }
                return true;
        };
        if (!dfs(0, -1, 0)) return -1;
        return white_cnt;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    G.resize(N);
    rep(i,N){
        rep(j,N){
            cin >> G1[i][j];
            if(G1[i][j] == '1')G[i].push_back(j);
        }
    }
    /* rep(i,N){
        for(auto e: G[i]){
            cout << i << " " <<  e;
        }
    } */
    if(BipartiteGraph(G) == -1){
        cout << -1 << endl;
        return 0;
    }

    int ans = -1;
    rep(i, N){
        ans = max(ans, bfs(i));
        //cout << endl;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int bfs(int)':
a.cc:27:17: error: expected primary-expression before ']' token
   27 |         if(used[])
      |                 ^
Language: Java

import java.util.*;

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

		boolean[][] s = new boolean[200][200];
		int[] num = new int[200];

		for(int i = 0 ; i < n ; i++){
			String tmp = sc.next();
			for(int j = 0 ; j < n ; j++){
				s[i][j] = (tmp.charAt(j) == '1');
			}
		}

		int ans = -1;

		for(int k = 0 ; k < n ; k++){
			LinkedList<Integer> que = new LinkedList<Integer>();
			int kans = -1;

			for(int i = 0 ; i < n ; i++){
				num[i] = 0;
			}

			que.add(k);
			num[k] = 1;

			while(que.size() > 0){
				Integer vNum = que.poll();
				for(int i = 0 ; i < n ; i++){
					if(num[i] == 0){
						if(s[vNum][i]){
							num[i] = num[vNum]+1;
							que.add(i);
						}
					}
				}
			}

			for(int i = 0 ; i < n ; i++){
				if(kans < num[i]){
					kans = num[i];
				}
			}

			for(int i = 0 ; i < n-1 ; i++){
				for(int j = i+1 ; j < n ; j++){
					if(s[i][j]){
						if((num[i] - num[j] != 1) && (num[j] - num[i] != 1){
							kans = -1;
							break;
						}
					}
				}
			}

			if(ans < kans){
				ans = kans;
			}
		}

		System.out.println(ans);
	}
}

Compiler output:
Main.java:54: error: ')' expected
						if((num[i] - num[j] != 1) && (num[j] - num[i] != 1){
						                                                   ^
1 error
Language: C++

#include<cmath>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=210;
int n,tot,k,s,ans,w[N][N],dis[N][N],vis[N],pre[N][N],f[N],tmp[N];
int find(int x){
	return x==f[x]?x:f[x]=find(f[x]);
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		f[i]=i;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			char c;
			do c=getchar();
			while(!isdigit(c));
			if(i<j&&c=='1'){
				int fx=find(i),fy=find(j);
				f[fy]=fx;
			}
			dis[i][j]=w[i][j]=('1'-c)*99999999+1;
			if(i==j)
				dis[i][j]=0;
		}
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++){
				if(dis[i][k]+dis[k][j]<dis[i][j]){
					dis[i][j]=dis[i][k]+dis[k][j];
					pre[i][j]=pre[k][j];
				}
			}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			if(dis[i][j]!=1e9)
				tmp[find(i)]=max(tmp[find(i)],dis[i][j]+1);
		for(int j=1;j<=n;j++)
			for(int k=j;k;k=pre[i][k])
				vis[k]=i;
		for(int j=1;j<=n;j++){
			if(vis[j]==i){
				for(int k=1;k<=n;k++){
					if(vis[k]==i&&w[j][k]==1&&pre[i][j]!=k&&pre[i][k]!=j){
						if(abs(dis[i][j]-dis[i][k])!=1){
							puts("-1");
							return 0;
						}
					}
				}
			}
		}
	}
	for(int i=1;i<=n;i++)
		if(i==find(i))
			ans+=tmp[i];
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:32: error: 'isdigit' was not declared in this scope
   18 |                         while(!isdigit(c));
      |                                ^~~~~~~
Language: C++

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

using namespace std;

int solve(int N, const vector<string> &A, int s)
{
	//cout << "s=" << s << endl;

	vector<string> T = A;

	vector<int> v;
	v.push_back(s);

	int ans = 0;
	while (!v.empty()) {
		++ans;
		vector<int> next;
		for (auto x : v) {
			for (int i = 0; i < N; ++i) {
				if (T[x][i] == '1') {
					next.push_back(i);
					//cout << i << " ";
					T[x][i] = '0';
					T[i][x] = '0';
				}
			}
		}
		//cout << endl;
		const int m = next.size();
		for (int i = 0; i < m; ++i) {
			for (int j = i + 1; j < m; ++j) {
				if (A[next[i]][next[j]] == '1') {
					//cout << "ng" << endl;
					return -1;
				}
			}
		}
		
		v = move(next);
	}
	return ans;
}

int solve(int N, const vector<string> &A)
{
	int ans = -1;
	int s;
	for (s = 0; s < N; ++s) {
		if (count(A[s].begin(), A[s].end(), '1') == 1) {
			ans = max(ans, solve(N, A, s));
		}
	}
	return ans;
}

int main()
{
	int N;
	cin >> N;
	vector<string> S(N);
	for (auto &x : S) {
		cin >> x;
	}

	cout << solve(N, S) << endl;
}


Compiler output:
a.cc: In function 'int solve(int, const std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:52:21: error: 'count' was not declared in this scope
   52 |                 if (count(A[s].begin(), A[s].end(), '1') == 1) {
      |                     ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>

int main() {
	int n; std::cin >> n;
	std::vector<std::string> edges(n); 
	for (auto& line : edges) std::cin >> line;
	std::vector<int> state(n, -1);
	std::vector<std::vector<int>> sub_graphs;
	bool is_biparate = true;
	for (auto i = 0; i < n && is_biparate; ++i) {
		if (state[i] == -1) {
			std::stack<int> stack;
			std::vector<int> vertex;
			stack.push(i);
			vertex.push_back(i);
			state[i] = 0;
			while (!stack.empty()) {
				auto top = stack.top(); stack.pop();
				for (auto to = 0; to < n; ++to) if (edges[top][to] == '1') {
					if (state[top] == state[to]) {
						is_biparate = false;
						stack.swap(std::stack<int>());
						break;
					}
					else if (state[to] == -1) {
						state[to] = 1 - state[top];
						stack.push(to);
						vertex.push_back(to);
					}
				}
			}
			sub_graphs.push_back(vertex);
		}
	}
	if (!is_biparate) {
		std::cout << -1 << std::endl;
	}
	else {
		std::vector<std::vector<int>> min_distance(n, std::vector<int>(n, INT_MAX));
		for (auto i = 0; i < n; ++i) for (auto j = 0; j < n; ++j) {
			if (edges[i][j] == '1') {
				min_distance[i][j] = 1;
			}
			if (i == j) min_distance[i][j] = 0;
		}
		for (auto k = 0; k < n; ++k) {
			for (auto i = 0; i < n; ++i) if (min_distance[i][k] != INT_MAX) {
				for (auto j = 0; j < i; ++j) if (min_distance[k][j] != INT_MAX) {
					min_distance[i][j] = min_distance[j][i] = std::min(min_distance[i][j], min_distance[i][k] + min_distance[k][j]);
				}
			}
		}
		long long int result = 0;
		for (const auto& sub : sub_graphs) {
			int max_distance = 0;
			for (auto i = 0; i < sub.size(); ++i) {
				for (auto j = 0; j < i; ++j) {
					max_distance = std::max(max_distance, min_distance[sub[i]][sub[j]]);
				}
			}
			result += max_distance + 1;
		}
		std::cout << result << std::endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:65: error: cannot bind non-const lvalue reference of type 'std::stack<int>&' to an rvalue of type 'std::stack<int>'
   42 |                                                 stack.swap(std::stack<int>());
      |                                                                 ^~~~~~~~~~~~
In file included from /usr/include/c++/14/stack:63,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_stack.h:299:19: note:   initializing argument 1 of 'void std::stack<_Tp, _Sequence>::swap(std::stack<_Tp, _Sequence>&) [with _Tp = int; _Sequence = std::deque<int, std::allocator<int> >]'
  299 |       swap(stack& __s)
      |            ~~~~~~~^~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <queue>
#define MOD 998244353
using namespace std;

int main() {
  long long N;
  cin >> N;
  string X;
  cin >> X;
  
  long long pow_2 = 0, N_help = N;
  while (N_help % 2 == 0){
    N_help /= 2;
    pow_2++;
  }
  
  priority_queue<long long> yakusu;
  for (int i = 1; i <= N_help; i++){
    if (N_help % i == 0) yakusu.push(i);
  }
  
  long long count = 1, help[N];
  help[0] = 1;
  for (int i = 1; i <= N; i++){
    if (i != 0) help[i] = help[i - 1] << 1;
    count += (X[N - i] - '0') * help[i];
    count %= MOD;
    help[i] %= MOD;
  }
  count *= 2 * N;
  count %= MOD;
  
  while (!yakusu.empty()) {
    long long a = yakusu.front();
    yakusu.pop();
    
  }
  
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:26: error: 'class std::priority_queue<long long int>' has no member named 'front'
   37 |     long long a = yakusu.front();
      |                          ^~~~~
Language: C++

#include "stdafx.h"

#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll mod = 998244353;
ll modnum(string S) {
	ll res = 0;
	ll cur = 1;
	reverse(all(S));
	for (int i = 0; i < S.size(); i++) {
		if (S[i] - '0')res += cur;
		cur *= 2;
		cur %= mod;
	}
	return res;
}
int co(string a,string b) {
	for (int i = 0; i < a.size(); i++) {
		if (a[i] == '0' && b[i] == '1')return 1;
		else if (a[i] == '1' && b[i] == '0')return 0;
	}
	return 1;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int N;
	string X;
	cin >> N >> X;
	if (N % 3 != 0) {
		puts((2LL*N*(modnum(X)+1))%mod);
		return 0;
	}

	string Xtemp;
	for (int i = 0; i < N / 3; i++)Xtemp += X[i];
	ll cnt1 = modnum(Xtemp);


	string comp;
	comp += Xtemp;
	for (int i = 0; i < N / 3; i++) {
		if (Xtemp[i] == '1')comp.pb('0');
		else comp.pb('1');
	}
	comp += Xtemp;

	if (co(comp, X))cnt1 += 1;


	ll ans = 0;
	ll cnt2 = modnum(X) + 1;
	cnt2 -= cnt1;
	cnt2 += mod;
	cnt2 %= mod;
	ans = 2LL*cnt1 * ((ll)N / 3LL) + cnt2 * ((ll)N * 2LL);
	ans %= mod;
	puts(ans);

	return 0;
}

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

#if 0
date +%Y.%m.%d

题解先咕着。
#endif
#include <cstdio>
#define debug(...) fprintf(stderr, __VA_ARGS__)

typedef long long lolong;

inline int input() { int x; scanf("%d", &x); return x; }

const int maxn = 200005, mod = 998244353;
char s[maxn];
int X[maxn];
int to[maxn];
lolong p2[maxn];
lolong a[maxn];

lolong power(lolong x, int k) {
	if(k < 0) k += mod - 1;
	lolong res = 1;
	while(k) {
		if(k & 1) (res *= x) %= mod;
		(x *= x) %= mod;
		k >>= 1;
	}
	return res;
}

int main() {
	int n = input();
	scanf("%s", s + 1);

	p2[0] = 1;
	for(int i = 1; i <= n; i ++)
		p2[i] = (p2[i - 1] << 1) % mod;

	int p = 0;
	for(int x = 1; x * x <= n; x ++)
		if(!(n % x)) {
			if((n / x) & 1)
				X[++ p] = x;
			if(x & 1 and x * x != n)
				X[++ p] = n / x;
		}

	for(int k = 1; k <= p; k ++) {
		int x = X[k];
		int &t = to[x];
		t = x;
		while(t < n and s[t + 1] != s[t + 1 - x])
			t ++;
		/* debug("%d -> %d\n", x, t); */
	}

	for(int k = 1; k <= p; k ++) {
		int x = X[k];
		a[x] = x << 1;
		for(int l = 1; l <= p; l ++) {
			int y = X[l];kj
			if(!(y % x) and y != x)
				a[x] += mod - (y << 1) % mod;
		}
		a[x] %= mod;
		/* debug("%d : %lld\n", x, mod - a[x]); */
	}

	lolong ans = 0;

	for(int i = 1; i <= n; i ++)
		if(s[i] == '1') {
			/* ans += p2[n - i] * (n << 1) % mod; */
			for(int k = 1; k <= p; k ++) {
				int x = X[k];
				if(i <= x) {
					/* debug(">%d %d %lld\n", i, x, p2[x - i]); */
					ans += a[x] * p2[x - i] % mod;
					/* ans += (mod - (n << 1) + (x << 1)) * p2[x - i] % mod; */
				}
				else if(to[x] == i - 1) {
					/* debug(">>%d %d\n", i, x); */
					/* ans += a[x] * p2[x - i] % mod; */
					ans += a[x];
				}
			}
			ans %= mod;
			/* debug("%lld\n", ans); */
		}

	for(int k = 1; k <= p; k ++)
		if(to[X[k]] == n) {
			(ans += X[k] << 1) %= mod;
			break;
		}

	printf("%lld\n", ans);
}


Compiler output:
a.cc:4:1: error: extended character 。 is not valid in an identifier
    4 | 题解先咕着。
      | ^
a.cc: In function 'int main()':
a.cc:61:38: error: 'kj' was not declared in this scope; did you mean 'k'?
   61 |                         int y = X[l];kj
      |                                      ^~
      |                                      k