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

#include <bits/stdc++.h>
using namespace std;
//最大公約数を求めるプログラム
int answer(int a, int b, int c) {
  int A;
  A = min(a, min(b, c));
  for (int i = 1; i < A + 1; i++) {
    if (
    
    


Compiler output:
a.cc: In function 'int answer(int, int, int)':
a.cc:8:9: error: expected primary-expression at end of input
    8 |     if (
      |         ^
a.cc:8:9: error: expected ')' at end of input
    8 |     if (
      |        ~^
      |         )
a.cc:8:9: error: expected statement at end of input
a.cc:8:9: error: expected '}' at end of input
a.cc:7:35: note: to match this '{'
    7 |   for (int i = 1; i < A + 1; i++) {
      |                                   ^
a.cc:8:9: error: expected '}' at end of input
    8 |     if (
      |         ^
a.cc:4:33: note: to match this '{'
    4 | int answer(int a, int b, int c) {
      |                                 ^
a.cc:8:9: warning: no return statement in function returning non-void [-Wreturn-type]
    8 |     if (
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//最大公約数を求めるプログラム
int answer(int a, int b, int c) {
  int A;
  A = maximum(a,maximum(b,c))
    

Compiler output:
a.cc: In function 'int answer(int, int, int)':
a.cc:6:17: error: 'maximum' was not declared in this scope; did you mean 'fmaximum'?
    6 |   A = maximum(a,maximum(b,c))
      |                 ^~~~~~~
      |                 fmaximum
a.cc:6:7: error: 'maximum' was not declared in this scope; did you mean 'fmaximum'?
    6 |   A = maximum(a,maximum(b,c))
      |       ^~~~~~~
      |       fmaximum
a.cc:6:30: error: expected '}' at end of input
    6 |   A = maximum(a,maximum(b,c))
      |                              ^
a.cc:4:33: note: to match this '{'
    4 | int answer(int a, int b, int c) {
      |                                 ^
a.cc:6:30: warning: no return statement in function returning non-void [-Wreturn-type]
    6 |   A = maximum(a,maximum(b,c))
      |                              ^
Language: C

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

int gcd(int l,int s) {
  int L,S;
  while(l%s!=0) {
    L=l;
    S=s;
    l=max(S,L%S);
    s=min(S,L%S);
  }
  return s;
}
int gcd3(int a,int b,int c) {
  b = gcd(max(a,b),min(a,b));
  return gcd(max(b,c),min(b,c));
}

int main() {
  int K,ans=0;
  cin >> K;
  for(int i=1;i<=K;i++) {
	for(int j=1;j<=K;j++) {
      for(int k=1;k<=K;k++) {
        ans+=gcd3(i,j,k);
      }
    }
  }
  cout << ans << 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<iostream>
#include<algorithm>
using namespace std;

int main(){
	int N, i, j, k;
	cin >> N;
	
	int ans=0;
	for(i=1; i<=N; i++){
		for(j=1; j<=N; j++){
			for(k=1; k<=N; k++){
				ans += __gcd(__gcd(i,j),k);
			}
		}
	}
	
	cout << ans << endl;
	return 0;
}


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

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

int n;
int gcd(int a,int b)
{
  return b==0?a:gcb(b,a%b);
}
int main()
{
    scanf("%d",&n);
    int ans = 0;
    for(int i = 1;i <= n;i++)
    {
        for(int j = 1;j<=n;j++)
        {
            int temp = gcd(i,j);
            for(int k = 1;k<=n;k++)
            {

                ans+=gcd(k,temp);
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:17: error: 'gcb' was not declared in this scope; did you mean 'gcd'?
    8 |   return b==0?a:gcb(b,a%b);
      |                 ^~~
      |                 gcd
Language: Java

import java.util.*;
class Main{
    private static int gcd(int a,int b){
        if(a<b) return gcd(b,a);
        if(b==1) return a;
        return gcd(b,b%a);
    }
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int N = sc.nextInt();
        int ans=0;
        for(int a=1;i<=N;i++){
            for(int b=1;b<=N;b++){
                for(int c=1;c<=N;c++){
                    ans=ans+gcd(a,gcd(b,c));
                }
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:12: error: cannot find symbol
        for(int a=1;i<=N;i++){
                    ^
  symbol:   variable i
  location: class Main
Main.java:12: error: cannot find symbol
        for(int a=1;i<=N;i++){
                         ^
  symbol:   variable i
  location: class Main
2 errors
Language: Java

import java.util.*;
class Main{
    private static int gcd(int a,int b){
        if(a<b) return gcd(b,a);
        if(b==1) return a;
        return (b,b%a);
    }
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args){
        int N = sc.nextInt();
        int ans=0;
        for(int a=1;i<=N;i++){
            for(int b=1;b<=N;b++){
                for(int c=1;c<=N;c++){
                    ans=ans+gcd(a,gcd(b,c))+
                }
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:6: error: ')' expected
        return (b,b%a);
                   ^
Main.java:6: error: ';' expected
        return (b,b%a);
                     ^
Main.java:16: error: illegal start of expression
                }
                ^
3 errors
Language: C++

#include<math.h>
#include<cmath>
#include<cstdio>
using namespace std;
int n;
int main()
{
	scanf("%d", &n);
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			for (int k = 1; k <= n; k++)
			{
				ans += __gcd(i,j,k);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: '__gcd' was not declared in this scope
   16 |                                 ans += __gcd(i,j,k);
      |                                        ^~~~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << ans << endl;
      |         ^~~~
a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cstdio>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:20:24: error: 'endl' was not declared in this scope
   20 |         cout << ans << endl;
      |                        ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cstdio>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include<math.h>
#include<cmath>
#include<cstdio>
#include <Windows.h>
#include <MMSystem.h>

using namespace std;

int n;

int main()
{
	scanf("%d", &n);
	int ans = 0;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			for (int k = 1; k <= n; k++)
			{
				ans += __gcd(i,j,k);
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <stack>

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

int memo[210][210];
int gcd(int a, int b){ return (a%b ? gcd(b, a%b): b);}

using namespace std;
int main() {
	int n;
	cin >> n;
	long long res = 0;
	for (int i = 0; i < 210; i++){
		for (int j = 0; j < 210; j++){
			memo[i][j] = 10000;
		}
	}
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n; j++){
			int a, b;
			if (memo[i][j] != 10000){
				a = memo[i][j];
			} else {
				memo[i][j] = gcd(i, j);
				a = memo[i][j];
			}
			for (int k = 1; k <= n; k++){
				if (memo[a][k] != 10000){
					b = memo[a][k];
				} else {
					memo[a][k] = gcd(a, k);
					b = memo[a][k];
				}
				res += b;
			}
		}
	}

	cout << res << endl;


}


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

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

int gcd(int x,int y) {
if (x % y == 0) {
  return y;
}
else {
return gcd(y,x % y);
}
}

int main () {
int K;
cin >> K;
int i,sum;
for (i = 0;i < K;i++) {
for (j = 0;j < K;j++) {
for (k = 0;k < K;k++) {
gcd(gcd(j,k),i);
sum += gcd(gcd(j,k),i);
}
}
}
cout << sum << endl;
}

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

int gcd(int p, int q){
2 if(p % q == 0)return q;
3 return gcd(q, p % q);
4 }

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:2:2: error: expected ';' before 'if'
    2 | 2 if(p % q == 0)return q;
      |  ^~~
      |  ;
a.cc:3:2: error: expected ';' before 'return'
    3 | 3 return gcd(q, p % q);
      |  ^~~~~~~
      |  ;
a.cc:4:2: error: expected ';' before '}' token
    4 | 4 }
      |  ^~
      |  ;
a.cc:4:3: warning: no return statement in function returning non-void [-Wreturn-type]
    4 | 4 }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 
int gcd_[205][205];
int main()
{
	int a;
	long long sum = 0;
	scanf("%d", &a);
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= a; j++)
			gcd[i][j] = __gcd(i, j);
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= a; j++)
			for(int k = 1; k <= a; k++)
				sum += gcd_[gcd_[i][j]][k];
	printf("%lld\n", sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   11 |                         gcd[i][j] = __gcd(i, j);
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 
int gcd[205][205];
int main()
{
	int a;
	long long sum = 0;
	scanf("%d", &a);
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= a; j++)
			gcd[i][j] = __gcd(i, j);
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= a; j++)
			for(int k = 1; k <= a; k++)
				sum += gcd[gcd[i][j]][k];
	printf("%lld\n", sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: reference to 'gcd' is ambiguous
   11 |                         gcd[i][j] = __gcd(i, j);
      |                         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:3:5: note:                 'int gcd [205][205]'
    3 | int gcd[205][205];
      |     ^~~
a.cc:15:40: error: reference to 'gcd' is ambiguous
   15 |                                 sum += gcd[gcd[i][j]][k];
      |                                        ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:3:5: note:                 'int gcd [205][205]'
    3 | int gcd[205][205];
      |     ^~~
a.cc:15:44: error: reference to 'gcd' is ambiguous
   15 |                                 sum += gcd[gcd[i][j]][k];
      |                                            ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:3:5: note:                 'int gcd [205][205]'
    3 | int gcd[205][205];
      |     ^~~
Language: C++

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

#define ull unsigned long long
#define endl '\n'
#define ll long long
const int N = 2e5 + 5;
int main(){
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        //freopen("VLJUM.INP", "r", stdin);
        //freopen("VLJUM.OUT", "w", stdout);
        ll n;
        cin >> n;
        ll sum = 0;
        for (int i = 1; i <= n; i++){
                for (int j = 1; j <= n; j++){
                        for (int k = 1; k <= n; k++){
                                sum += __gcd(i, j, k);
                        }
                }
        }
        cout << sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:45: error: no matching function for call to '__gcd(int&, int&, int&)'
   20 |                                 sum += __gcd(i, j, k);
      |                                        ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   candidate expects 2 arguments, 3 provided
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a,sum=0;
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		for(int j=1;j<=n;++j)
		{
			a=__gcd(i,j);
			for(int k=1;k<=n;++k)
			{
				sum=sum+__gcd(a,k);
			}
		}
	}
	printf("%d\n",sum);
	return 0;
}

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

from itertools import combinations
import fractions
n = int(input())
ans = 0
for r in range(1,4): 
    if r>n:
        break
    for x  in combinations([x+1 for x in range(n)],r):
        if len(x)==1:
            ans += x[0]
        elif len(x)==2:
            ans += fractions.gcd(x[0],x[1])*6
        else:
            tmp = fractions.gcd(x[0],x[1])
            ans += fractions.gcd(x[2],tmp)*6

Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from itertools import combinations
      | ^~~~
main.c:1:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from itertools import combinations
      |                ^~~~~~
main.c:1:16: error: unknown type name 'import'
Language: C

#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {
   /* #ifndef ONLINE_JUDGE
        // for getting input from input.txt
        freopen("input.txt", "r", stdin);
        // for writing output to output.txt
        freopen("output.txt", "w", stdout);
    #endif*/
        /* 
        Ofcourse it's Hard.
        It's supposed to be Hard.
        If it's easy everyone would do it.
        HARD IS WHAT MAKES IT GREAT

        YESTERDAY U SAID TOMORROW

        SLOWLY BECOMING THE PERSON I 
        SHOULD HAVE BEEN A LONG TIME AGO

        SAME TASK CAN'T BE FOUND DIFFICULT TWICE

        BTBHWSITW

        SPRH TU KAB P

        CP IS ALL ABOUT THINKING 
        YOU HAVE MUCH MORE POTENTIAL THAN U THINK

        AJIT SHIDDAT 10

        UR DAILY ROUTINE 


        */

fast();
//ll t;cin>>t;while(t--)
{
    ll k,s=0;
    cin>>k;
    for(int a=1;a<=k;a++)
    {
        for(int b=1;b<=k;b++)
        {
            for(int c=1;c<=k;c++)
            {
                 ll temp=gcd(a,b);
                 s+=(gcd(temp,c));
            }
        }
    }
    cout<<s<<endl;
}
return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

template <class T> T gcd(T a, T b) {
	if (a < b) swap(a, b);
	while (b) {
		a = a % b;
		swap(a, b);
	}
	return a;
}

class Solution {
public:
	void solve() {
		int x;
		cin >> x;
		long long ans = 0;
		for (int i = 1; i <= x; i++) {
			for (int j = 1; j <= x; j++) {
				for (int k = 1; k <= x; k++) {
					ans += gcd(i, gcd(j, k));
				}
			}
		}
		cout << ans << "\n";

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

int Question162C(void) {
	int input =0;
	int num = 0;
	int output =0;

	scanf("%d", &input);
	for (int k = 1; k <= input; k++) {
		for (int i = 1; i <= input; i++) {
			for (int j = 1; j <= input; j++) {
				num = num + gcd(gcd(j, i), k);
			}
		}
	}

	output = num;
	printf("%d\n", output);
	return 0;
}

//ユークリッドの互除法により最大公約数を求める関数
int gcd(int p, int q) {
	 while (q != 0) {
		 int r = p % q;
		 p = q;
		 q = r;
	}
	 return p;
}

Compiler output:
main.c: In function 'Question162C':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d", &input);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int Question162C(void) {
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d", &input);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:45: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   10 |                                 num = num + gcd(gcd(j, i), k);
      |                                             ^~~
main.c:16:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   16 |         printf("%d\n", output);
      |         ^~~~~~
main.c:16:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:16:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int gcd(int x, int y)
{
    int r;

    // 引数チェック
    if (x == 0 || y == 0)
    {
        return 0;
    }

    // ユーグリッドの互除法
    // yで割り切れるまでループ
    while ((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

int main(int argc, const char *argv[])
{
    int k;
    cin >> k;

    int sum = 0, x;
    for (int a = 1; a <= k; a++)
    {
        for (int b = 1; b <= k; b++)
        {
            for (int a = c; c <= k; c++)
            {
                x = gcd(a, b);
                x = gcd(c, x);
                sum += x;
            }
        }
    }
    cout << x << endl;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:36:26: error: 'c' was not declared in this scope
   36 |             for (int a = c; c <= k; c++)
      |                          ^
Language: C

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

#define ll long long int
#define mod 1000000007

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;


int main()
{  
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int K;
    cin>>K;
    ll ans=0;
    for(int i=1;i<=K;i++){
		for(int j=1;j<=K;j++){
			for(int k=1;k<=K;k++){
				int x=__gcd(i,j);
				ans+=__gcd(x,k);
			}
		}
	}
	cout<<ans<<"\n";
}


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;
int p,sum;
#define MAXN 305
int f[MAXN][MAXN];

int gcd(int a,int b)
{
    //if(!b)return a;
    //return gcd(b,a%b);
    if(f[a][b]!=-1)return f[a][b];
    else
    {
        int aa=a,bb=b;
        int c;
        while(b)
        {
            c=a%b;
            a=b;
            b=c;
        }
        return f[aa][bb]=a;
    }
}
int main()
{
    memset(f,-1,sizeof f);
    scanf("%d",&p);
    for(int i=1;i<=p;i++)
    for(int j=1;j<=p;j++)
    for(int k=1;k<=p;k++)
    {
        sum+=gcd(gcd(i,j),k);
    }
    printf("%d\n",sum);
    return 0 ;
}


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <numeric>
#include <set>
#include <iomanip>
#include <functional>
#define FOR(i, a, n) for (long long i = (a); i < (n); i++)
#define REP(i, n) for(long long i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
using namespace std;

typedef long long ll;

long long Mygcd(long long a, long long b)
{
	if (a % b == 0)return b;
	return Mygcd(b, a % b);
}

int Mygcd(int a, int b)
{
	if (a % b == 0)return b;
	return Mygcd(b, a % b);
}

long long Mylcm(long long a, long long b)
{
	return a * b / Mygcd(a, b);
}

int Mylcm(int a, int b)
{
	return a * b / Mygcd(a, b);
}

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

	int N,ans;

	cin >> N;
	ans = 0;

	FOR(i,1,N+1)
	{
		FOR(j, 1, N + 1)
		{
			FOR(k, 1, N + 1)
			{
				ans += Mygcd(Mygcd(i, j), k);
			}
		}
	}

	cout << ans << endl;

	return 0;
}

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

#include <bits/stdc++.h>
#define REP(i, a, b) for (long long i = a; i <= b; ++i)
#define ll long long
using namespace std;
ll n, ans;
inline ll read(){                                     
    ll s = 0, w = 1;
    char ch = getchar();
    for (; ch < '0' || ch > '9'; ch = getchar()) w *= ch == '-' ? -1 : 1;
    for (; ch >= '0' && ch <= '9'; ch = getchar()) s = s * 10 + ch - '0';
    return s * w;
}
inline ll gcd(ll a, ll b){                              
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}
inline void work(){
    n = read();                                        
    REP(i, 1, n)                                        
        REP(j, 1, n)                                    
            REP(k, 1, n){                                
                if (min(i, min(j, k)) == 1) ans++;      
                else if (i == j && j == k) ans += i;   
                    else ans += gcd(i, gcd(j, k));      
            }
    printf("%lld\n", ans);                            
}
int main(){
    work();
    return 0;
}

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

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np
 
K = INT()
sum = 0
 
for n in range(K):
  for m in range(K):
    for l in range(K):
      sum += gcd(n+1, gcd(m+1, l+1))
 
print(sum)

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys, re
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'from'
    2 | from collections import deque, defaultdict, Counter
      | ^~~~
main.c:17:13: warning: multi-character character constant [-Wmultichar]
   17 | INF = float('inf')
      |             ^~~~~
Language: C

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

// ABC 162 c

long long GCD(long long x, long long y){
  if (y == 0) return x;
  else return GCD(y, x % y);
}

int main() {
  int k;
  cin >> k;
  int res = 0;
  for (int a = 1; a <= k; a++) {
    for (int b = 1; b <= k; b++) {
      for (int c = 1; c <= k; c++) {
        res += GCD(GCD(a, b), c);
      }
    }
  }
  cout << res << "\n";
}


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

from math import gcd
k = int(input())
ans = 0
for a in range(1, k + 1):
  for b in range(1, k + 1):
    for c in range(1, k + 1):
      ans += gcd(gcd(a, b), c)
print(ans)

Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from math import gcd
      | ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from math import gcd
      |           ^~~~~~
main.c:1:11: error: unknown type name 'import'
Language: Java

import java.util.Scanner;

public class C_SumofGCDofTuples {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int k = scan.nextInt();
		int ans = 0;
		for(int a = 1 ; a <= k ; a++) {
			for(int b = 1 ; b <= k ; b++) {
				for(int c = 1 ; c <= k ; c++) {
					ans += gcd(a,b,c);
				}
			}
		}
		System.out.println(ans);
		scan.close();
	}

	private static int gcd(int a, int b, int c) {
		int d = gcd2(a,b);
		
		return gcd2(c,d);
		
	}

	private static int gcd2(int a, int b) {
		if(b == 0) return a;
		
		return a % b == 0 ? b : gcd2(b , a % b);
	}

}


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

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

int gcd(int p,int q){
    if(p%q == 0){
        return q;
    }else{
        gcd(q,p%q);
    }
}

int main(){
    int k; cin >> k;
    int sum = 0;

    for(int a=1; a<=k; a++){
        for(int b=1; b<=k; b++){
            for(int c = 1; c<=k; c++){
                int d = gcd(b,c);
            }
        }
        sum += gcd(a,d);
    }

    cout << sum << endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'd' was not declared in this scope
   23 |         sum += gcd(a,d);
      |                      ^
a.cc: In function 'int gcd(int, int)':
a.cc:9:12: warning: control reaches end of non-void function [-Wreturn-type]
    9 |         gcd(q,p%q);
      |         ~~~^~~~~~~
Language: C

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

int gcd(int p,int q){
    if(p%q == 0){
        return q;
    }else{
        gcd(q,p%q);
    }
}

int main(){
    int k; cin >> k;
    int sum = 0;

    for(int a=1; a<=k; a++){
        for(int b=1; b<=k; b++){
            for(int c = 1; c<=k; c++){
                int d = gcd(b,c);
            }
        }
        sum += gcd(a,d);
    }

    cout << sum << endl;
    
}



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

#include <bits/stdc++.h>
#define r(i,n) for(int i = 1; i<=n; i++)
typedef long long ll;
using namespace std;
const ll mod=1000000007;

ll gcd(ll a, ll b){
  if(b==0)return a;
  else return gcd(b,a%b);
}

int main() {
  int k,sum=0;
  cin >> k;
  r(i,k){
    r(j,k){
      r(h,k){
        sum+=gcd(i,gcd(j,h));
      }
    }
  }
  cout<<sum<<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;
typedef long long ll;
typedef pair <int, int> P;

void printVec(std::vector<int> &vec) {
  std::cout << "";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    std::cout << *it << " ";
  }
  std::cout << std::endl;
}

int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }

int main() {
  int k;
  cin >> k;

  ll ans = 0;
  vector <int> x(3);
  int x1, x2, x3;
   for (x1 = 1; x1 <= k; x1++) {
     for (x2 = 1; x2 <= k; x2++) {
       for (x3 = 1; x3 <= k; x3++) {
         // ans = ans + gcd(gcd(x1, x2), x3);
         ans = ans + gcd(x1, gcd(x2, x3));
       }
     }
   }
  cout << ans << endl;
	return 0;
}

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

#include <stdio.h>
int koyakusu(int a, int b);
int sgm(int c);
int main(void)
{
    int x;
    scanf("%d",&x);
    sgm(x);
    return 0;
   
    
    
}
int koyakusu(int a, int b){
    int r=1;
    while(r!=0){
        r = a%b;
        a = b;
        b = r;
    }
    return a;
}

int sgm(int c){
    int i = 1;
    int k = 1;
    int j = 1;
    int x;
    int y;
    int so;
    so = c*c*c;
    
    for(c; c >= i; i++){
        for(c; c >= k; k++){
            for(c; c >= j; j++){
                for(x = 1; so >= x; x++){
                    y = y + koyakusu(koyakusu(a,b),d);
                }
                
            }
        }
        
    }
    printf("%d",y);
    return y;
}


Compiler output:
main.c: In function 'sgm':
main.c:37:47: error: 'a' undeclared (first use in this function)
   37 |                     y = y + koyakusu(koyakusu(a,b),d);
      |                                               ^
main.c:37:47: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:49: error: 'b' undeclared (first use in this function)
   37 |                     y = y + koyakusu(koyakusu(a,b),d);
      |                                                 ^
main.c:37:52: error: 'd' undeclared (first use in this function)
   37 |                     y = y + koyakusu(koyakusu(a,b),d);
      |                                                    ^
Language: C

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < ( n ); ++i )
using namespace std;
using ll = long long;
using ull = unsigned long long;
using p  = pair<int, int>;
using vec_int = vector<int>;
using vec_str = vector<string>;
#define INF (1<<29)

void debug_input(vec_str& argv)
{
    // デバッグ用引数読み込み
    ifstream file("./input.txt");
    string str;
    while( getline(file, str) ) {
        argv.push_back(str);
    }
}

void debug_split_string(const string& str, vec_str& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        v.push_back(buf);
    }
}

void debug_split_int(const string& str, vec_int& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        istringstream ss(buf);
        int temp;
        ss >> temp;
        v.push_back(temp);
    }
}

long long gcd(long long x, long long y) {
  return y ? gcd(y, x % y) : x;
}

int main()
{
    int N = 0;
	cin >> N;

  	ll ans = 0;
    
    int temp = 0;
    for(int i = 1; i <= N; ++i ) {
        
        for( int j = 1; j <= N; ++j ) {
            
            temp = gcd(i, j);
            
            for( int k = 1; k <= N; ++k ) {
                    int temp2 = gcd(k, temp);
                  	ans += temp2;
            }
        }
    }
        

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

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

#include <stdio.h>
int koyakusu(int a, int b);
int sgm(int c);
int main(void)
{
    int x;
    scanf_s("%d",&x);
    sgm(x);
    return 0;
   
    
    
}
int koyakusu(int a, int b){
    int r=1;
    while(r!=0){
        r = a%b;
        a = b;
        b = r;
    }
    return a;
}

int sgm(int c){
    int a = 1;
    int b = 1;
    int d = 1;
    int i = 1;
    int k = 1;
    int j = 1;
    int x;
    int y;
    int so;
    so = c*c*c;
    
    for(a = 1; a >= i; i++){
        for(b = 1; b >= k; k++){
            for(d = 1; d >= j; j++){
                for(x = 1; so >= x; x++){
                    y = y + koyakusu(koyakusu(a,b),d);
                }
                
            }
        }
        
    }
    printf("%d",y);
    return y;
}


Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |     scanf_s("%d",&x);
      |     ^~~~~~~
      |     scanf
Language: C

#include<iostream>
using namespace std;

/* gcd(a,b,c) = gcd(gcd(a,b),c) */

int gcd(int a,int b){ /*ユークリッドの互除法*/
    if ( a % b == 0)
        return b;

    return gcd(b, a % b);
}

int main(){
    int k;
    int ans = 0;
    cin >> k;
    for(int i = 1;i <= k;i++){
        for(int j = 1;j <= k;j++){
            for(int l = 1;l <= k;l++){
                ans += gcd(gcd(i,j),k);
            }
        }
    }
    cout << ans << endl;
}

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

#include<iostream>

using namespace std;
const int N = 210;
int dp[N][N];

int gcd(int a, int b){
	if(dp[a][b]) return dp[a][b];
  	if(dp[b][a]) {
    	dp[a][b] = dp[b][a];
      	return dp[a][b];
    }
    else{
      aaaa = gcd(b, a - a / b * b);
      dp[a][b] = aaaa;
      dp[b][a] = aaaa;
      return aaaa;
    }
}

int main(){
  int k;
  cin >> k;
  for(int i = 1; i <= k; i ++){
  	for(int j = 1; j <= i; j ++){
    	gcd(i, j);
    }
  }
  long long res = 0;
  for(int i = 1; i <= k; i ++){
  	for(int j = 1; j <= k; j ++){
    	for(int m = 1; m <= k; m ++){
        	res += dp[dp[i][j]][dp[j][m]];
        }
    }
  }
 cout << res;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:14:7: error: 'aaaa' was not declared in this scope
   14 |       aaaa = gcd(b, a - a / b * b);
      |       ^~~~
Language: C++


#include <algorithm>  //sort,二分探索,など
#include <array>
#include <bitset>         //固定長bit集合
#include <cmath>          //pow,logなど
#include <complex>        //複素数
#include <deque>          //両端アクセスのキュー
#include <functional>     //sortのgreater
#include <iomanip>        //setprecision(浮動小数点の出力の誤差)
#include <iostream>       //入出力
#include <map>            //map(辞書)s
#include <numeric>        //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>          //キュー
#include <set>            //集合
#include <stack>          //スタック
#include <string>         //文字列
#include <unordered_map>  //イテレータあるけど順序保持しないmap
#include <unordered_set>  //イテレータあるけど順序保持しないset
#include <utility>        //pair
#include <vector>         //可変長配列

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())  // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main() {
  int k;
  cin >> k;
  ll ans = 0;
  REP(a, k + 1)
  REP(b, k + 1)
  REP(c, k + 1){ans += gcd(a, gcd(b, c))} cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:41: error: expected ';' before '}' token
   45 |   REP(c, k + 1){ans += gcd(a, gcd(b, c))} cout << ans << endl;
      |                                         ^
      |                                         ;
Language: C


#include <algorithm>  //sort,二分探索,など
#include <array>
#include <bitset>         //固定長bit集合
#include <cmath>          //pow,logなど
#include <complex>        //複素数
#include <deque>          //両端アクセスのキュー
#include <functional>     //sortのgreater
#include <iomanip>        //setprecision(浮動小数点の出力の誤差)
#include <iostream>       //入出力
#include <map>            //map(辞書)s
#include <numeric>        //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>          //キュー
#include <set>            //集合
#include <stack>          //スタック
#include <string>         //文字列
#include <unordered_map>  //イテレータあるけど順序保持しないmap
#include <unordered_set>  //イテレータあるけど順序保持しないset
#include <utility>        //pair
#include <vector>         //可変長配列

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())  // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main() {
  int k;
  cin >> k;
  ll ans = 0;
  REP(a, k + 1)
  REP(b, k + 1)
  REP(c, k + 1){ans += gcd(a, gcd(b, c))} cout << ans << endl;
  return 0;
}

Compiler output:
main.c:2:10: fatal error: algorithm: No such file or directory
    2 | #include <algorithm>  //sort,二分探索,など
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>

using namespace std;
int gcd(int x,int y){
	if(x<=y){int temp=x;x=y;y=temp;}
	if(y>0)return gcd(y,x%y);
	else return x;
}
int main(){
	int sum=0;
	int K;
	cin >> K;
	for(int i=1;i<=K;i++){
		for(int j=1;j<=K;j++){
			for(int k=1;k<=K;k++){
				sum+=gcd(gcd(i,j),k);
			}
		}
	}
	cout << sum << endl;
}

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

import sys
import numpy as np

N=int(input())
count = 0
j_check = 0
k_check = 0

for i in range(1,N+1):
    i_ins=[]
    for x in range(1,i+1):
        if i//x != 0 and i%x == 0:
            i_ins.append(x)
    for j in range(i,N+1):
        i_j_ins=[]
        for y in i_ins:
            if j//y != 0 and j%y == 0:
                i_j_ins.append(y)
        for k in range(j,N+1):
            i_j_k_ins=[]
            for z in reversed(i_j_ins):
                if k//z != 0 and k%z == 0:
                    i_j_k_ins.append(z)
                    break
            print(i,j,k,i_j_k_ins[-1])
            if i==j and j==k and k==i:
                count = count + i_j_k_ins[-1]
            elif i==j or j==k or k==i:
                count = count + i_j_k_ins[-1]*3
print(count)




Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    2 | import numpy as np
      | ^~~~~~
main.c:2:1: error: unknown type name 'import'
Language: C

import sys
import numpy as np

N=int(input())
count = 0
j_check = 0
k_check = 0

for i in range(1,N+1):
    i_ins=[]
    for x in range(1,i+1):
        if i//x != 0 and i%x == 0:
            i_ins.append(x)
            for j in range(1,N+1):
                i_j_ins=[]
                for y in i_ins:
                    if j//y != 0 and j%y == 0:
                        i_j_ins.append(y)
                    else:
                        count = count + N
                        break
        
                for k in range(N+1):
                    print(i,j,k,i_j_ins)
                    for z in i_j_ins:
                        if k//z != 0 and k%z == 0:
                            count = count + z
                        else:
                            count = count + 1
                            j_check = 1
                            break

print(count)


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    2 | import numpy as np
      | ^~~~~~
main.c:2:1: error: unknown type name 'import'
Language: C

#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, sol = 0;
	cin >> n;
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= n; ++j){
			for(int u = 1; u <= n; ++u){
				sol += __gcd(i,__gcd(j,u));
			}
		}
	}
	cout << sol << '\n';
}


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

import math
from functools import reduce

a=int(input())
b=[]
for i in range(1,a+1):
    for j in range(1,a+1):
        for n in range(1,a+1):
            c=reduce(math.gcd,[i,j,n])
            b.append(c)

print(sum(b))


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'from'
    2 | from functools import reduce
      | ^~~~
main.c:2:1: error: unknown type name 'from'
Language: C

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include <iomanip>
using namespace std;
int mgcd(int a,int b);
int mgcd(int a,int b){
        if(a%b==0){
            return b;
        }
        else{
            return mgcd(b,a%b);
        }
    }

int main(){
    long long int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=i;j++){
            for(int k=1;k<=j;k++){
            	if(i==j&&j==k&&i==k){
            		ans+=mgcd(k,mgcd(i,j));
            	}
            	else if(i==j||j==k||i==k){
            		ans+=3*mgcd(k,mgcd(i,j));
            	}
            	else{
            		ans+=6*mgcd(k,mgcd(i,j));
            	}
            }
        }
    }
    cout<<ans<<endl;
    
    return 0;
}

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

#include<iostream>
using namespace std;
int euclid(int, int);
void swap(int *, int *);

int main(void){
  int K;
  cin >> K;
  long result = 0;
  for (int a = 1; a <= K; a++){
    for (int b = 1; b <= K; b++){
      for (int c = 1; c <= K; c++){
        int ab  = euclid(a,b);
        int abc = euclid(ab,c);
        result = result + abc;
      }
    }
  }
  cout << result << endl;
  return 0;
}
int euclid(int small, int big){
  int amari = 0;
  if (small > big){
    swap(&small, &big);
  }
  while (true){
    if((amari = big % small) == 0)
      return small;
    big = small;
    small = amari;
  }
  return 0;
}


Compiler output:
/usr/bin/ld: /tmp/cc146X76.o: in function `euclid(int, int)':
a.cc:(.text+0xef): undefined reference to `swap(int*, int*)'
collect2: error: ld returned 1 exit status
Language: C

using System;
using static System.Console;
using static System.Int32;
using static System.Math;
using System.Linq;
using System.Collections.Generic;

class Solution
{
    static void Main()
    {
    lb:
        var k = Parse(ReadLine());
        int r = 0;
        for(int a = 1; a <= k; ++a)
        {
            for(int b = 1; b <= k; ++b)
            {
                for(int c = 1; c <= k; ++c)
                {
                    r += gcb(a, b, c);
                }
            }
        }
        WriteLine(r);
    }

    static int gcb(int a, int b, int c) => gcb(gcb(a, b), c);
    static int gcb(int a, int b)
    {
        if (a < b) (b, a) = (a, b);
        while (true)
        {
            var jy = a % b;
            if (jy == 0) return b;
            (a, b) = (b, jy);
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:6: error: expected ';' before 'static'
    2 | using static System.Console;
      |      ^~~~~~~
      |      ;
main.c:2:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using static System.Console;
      |                    ^
main.c:3:6: error: expected ';' before 'static'
    3 | using static System.Int32;
      |      ^~~~~~~
      |      ;
main.c:3:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using static System.Int32;
      |                    ^
main.c:4:6: error: expected ';' before 'static'
    4 | using static System.Math;
      |      ^~~~~~~
      |      ;
main.c:4:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | using static System.Math;
      |                    ^
main.c:5:1: error: unknown type name 'using'
    5 | using System.Linq;
      | ^~~~~
main.c:5:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | using System.Linq;
      |             ^
main.c:6:1: error: unknown type name 'using'
    6 | using System.Collections.Generic;
      | ^~~~~
main.c:6:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    6 | using System.Collections.Generic;
      |             ^
main.c:8:1: error: unknown type name 'class'
    8 | class Solution
      | ^~~~~
main.c:9:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    9 | {
      | ^
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
#define all(c) (c).begin(), (c).end()
#define rep( i, a, n ) for( int i=a; i<n; i++ )
#define repp( i, a, n, p ) for( int i=a; i<n; i+=p )
#define per( i, a, n ) for( int i=n-1; i>=a; i--)

int main () {
    int n;
    cin >> n;
    ll sum =0;

    rep ( i, 1, n+1 ) {
        rep ( j, 1, n+1 ) {
            rep ( k, 1, n+1 ) {
                sum += gcd ( i, gcd ( k, j ) );
            }
        }
    }
    cout << sum << 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 <iostream>
using namespace std;

int gcd(int a, int b){
  if(a % b == 0) return b;
  return gcd(b, a % b);
}

int main(){
  int n;
  cin >> n;
  long long sum = 0;
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      for(int k = 1; k <= n; k++){
        sum+= gcd(gcd(a,b),c);
      }
    }
  }
  
  cout << sum;
}
  
        
  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'a' was not declared in this scope
   16 |         sum+= gcd(gcd(a,b),c);
      |                       ^
a.cc:16:25: error: 'b' was not declared in this scope
   16 |         sum+= gcd(gcd(a,b),c);
      |                         ^
a.cc:16:28: error: 'c' was not declared in this scope
   16 |         sum+= gcd(gcd(a,b),c);
      |                            ^
Language: C++

#include <iostream>
using namespace std;

int gcd(int a, int b){
  if(a % b == 0) return b;
  return gcd(b, a % b);
 

int main(){
  int n;
  cin >> n;
  long long sum = 0;
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      for(int k = 1; k <= n; k++){
        sum+= gcd(gcd(a,b),c);
      }
    }
  }
  
  cout << sum;
}
  
        
  

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:9:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    9 | int main(){
      |         ^~
a.cc:9:9: note: remove parentheses to default-initialize a variable
    9 | int main(){
      |         ^~
      |         --
a.cc:9:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:9:11: error: a function-definition is not allowed here before '{' token
    9 | int main(){
      |           ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:22: note: to match this '{'
    4 | int gcd(int a, int b){
      |                      ^