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

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

int gcd(int x,int y,int z){
  int w;
  for(int i= min(x,min(y,z));i>=1;i--){
    if(x%i == 0 && y%i == 0 && z%i == 0){
      w = i;
      break;
    }
  }
  return w;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'k' was not declared in this scope
   17 |   cin >> k;
      |          ^
a.cc:21:20: error: 'a' was not declared in this scope
   21 |         ans += gcd(a,b,c);
      |                    ^
a.cc:21:22: error: 'b' was not declared in this scope
   21 |         ans += gcd(a,b,c);
      |                      ^
a.cc:21:24: error: 'c' was not declared in this scope
   21 |         ans += gcd(a,b,c);
      |                        ^
Language: C++

#include<iostream>
using namespace std; 
 
int gcd(int a,int b){
  if(a<b){
    a=a+b;
    b=a-b;
    a=a-b;
  }
  if(b==a){
    return b;
  }else if(b==1){
    return 1;
  }else{
    return gcd(a-b,b);
  }
}
 
int main(){
  int k;
  long long sum=0;
  for(int a=1;a<=k;a++){
    sum+=a;//gcd(a,a,a)
    for(int d=1;d<=k-a;d++){
      sum+=3*gcd(a,d);
      for(int f=1;f<=k-a-e;f++){
        sum+=6*gcd(a,gcd(d,f));
      }
    }
  }
  cout<<sum<<endl;
}
#include<iostream>
using namespace std; 

int gcd(int a,int b){
  if(a<b){
    a=a+b;
    b=a-b;
    a=a-b;
  }
  if(b==a){
    return b;
  }else if(b==1){
    return 1;
  }else{
    return gcd(a-b,b);
  }
}
 
int main(){
  int k;
  long long sum=0;
  for(int a=1;a<=k;a++){
    sum+=a;//gcd(a,a,a)
    for(int d=1;d<=k-a;d++){
      sum+=3*gcd(a,d);
      for(int f=1;f<=k-a-d;f++){
        sum+=6*gcd(a,gcd(d,f));
      }
    }
  }
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:26: error: 'e' was not declared in this scope
   26 |       for(int f=1;f<=k-a-e;f++){
      |                          ^
a.cc: At global scope:
a.cc:36:5: error: redefinition of 'int gcd(int, int)'
   36 | int gcd(int a,int b){
      |     ^~~
a.cc:4:5: note: 'int gcd(int, int)' previously defined here
    4 | int gcd(int a,int b){
      |     ^~~
a.cc:51:5: error: redefinition of 'int main()'
   51 | int main(){
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main(){
      |     ^~~~
Language: C++

#include<iostream>

int gcd(int a,int b){
  if(a<b){
    a=a+b;
    b=a-b;
    a=a-b;
  }
  if(b==a){
    return b;
  }else if(b==1){
    return 1;
  }else{
    return gcd(a-b,b);
  }
}

int main(){
  int k;
  long long sum=0;
  for(int a=1;a<=k;a++){
    sum+=a;//gcd(a,a,a)
    for(int d=1;d<=k-a;d++){
      sum+=3*gcd(a,d);
    }
    for(int e=1;e<=k-a;e++){
      for(int f=1;f<=k-a-e;f++){
        sum+=6*gcd(a,gcd(e,f));
      }
    }
  }
  cout<<sum<<endl;
}

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

#include <bits/stdc++.h>
#define forn(x, n)              for (int x = 0; x < n; x++)
#define forr(x, n)              for (int x = n; x >= 0; x--)
#define fore(x, a, b, c)        for (int x = a; x <= b; x += c)
#define forre(x, a, b, c)       for (int x = a; x >= b; x -= c)
#define clr                     cin.ignore(numeric_limits<streamsize>::max(), '\n')
#define all(container)          (container).begin(), (container).end()
#define rall(container)         (container).rbegin(), (container).rend()
#define FILL(x, val)            memset(x, val, sizeof(x))
#define sz(container)           ((int) (container).size())
#define pb                      push_back
#define eb                      emplace_back
#define fi                      first
#define se                      second
#define mod                     (ll)1000000007
#define INF                     (int)0x3f3f3f3f

using namespace std;

#ifdef LOCAL_DEFINE
    #include "../../CLionProjects/Codeforces/library/DEBUG.hpp"
#endif

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }  

typedef long long ll; 
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<long long, long long>> vpll;

void solve() {
    int n; cin >> n;
    int ans = 0;
    fore(i, 1, n, 1) fore(j, 1, n, 1) fore(k, 1, n, 1) ans += __gcd(i, __gcd(j, k));
    cout << ans << '\n';
}

int main(void) {    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("in.txt", "r", stdin);
#endif
    int t = 1; 
//    cin >> t;
    while (t--)
        solve();
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << '\n';
#endif
    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 <iostream>
#include <cmath>
#include <algorithm>
#include <string> //文字列
#include <iomanip> //doubleの桁数指定 setprecision()
#include <list> //前後に数値を入れれる配列
#include <map> //map
#include <vector> //vecror

#define REP(i,m,n) for(ll i = (ll) (m);i < (ll) (n);i++) //forの短縮
#define rep(i,n) REP(i,0,n) //REPが0の時
#define ll long long int

using namespace std;

double PI = acos(-1); //円周率
ll mod = 1e9 + 7;


//提出コード↓

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




ll k,sum;

int main() {
	cin >> k;
	REP(i,1, k + 1) {
		REP(j,1, k + 1) {
			REP(m,1, k + 1) {
				sum += gcd(gcd(i, j), m));
			}
		}
	}
	
	cout << sum << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:57: error: expected ';' before ')' token
   37 |                                 sum += gcd(gcd(i, j), m));
      |                                                         ^
      |                                                         ;
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;

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

ll gcd(ll a,ll b ,ll c){
 return gcd(c,gcd(a,b));
}


int main(){
 ll n;
 cin>>n;
 ll s = 0;
 for(ll i=1;i<=n;i++)
  for(ll j=1;j<=n;j++)
   for(ll k=1;k<=n;k++)
    s += gcd(i,j,k);
 cout<<s<<endl;
    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 <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <tuple>
#include <stdlib.h>
#define rep(i,n) for (int i = 1; i <= (n); ++i)
using namespace std;
#define PI 3.14159265358979
typedef long long int ll;
const int inf=1001001001;
ll absc(ll a,ll b){return (a-b>0?a-b:b-a);
}
ll mini(ll a,ll b){return (a>b?b:a);}
ll gcd(ll a,ll b){
	if(a<b)swap(a,b);
	return (a%b?gcd(a%b,b):b);
}
int main()
{
    ll a,b,c,n,sum=0,k;
    string s;
    cin>>k;
    for(int i=1;i<=k;i++)
    {
    	for(int j=i;j<=k;j++)
    	{
    		for(int l=j;l<=k;l++){
    			if(i==j&&j==l)sum+=gcd(i,gcd(j,l));
    			else if(i!=j&&j!=l)sum+=6*gcd(i,gcd(j,l));
    			else sum+=gcd(i,gcd(j,l))*3;
    		}
    	}
    }
    cout<<sum;
}


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

#include <iostream>
using namespace std;
int gcd(int b,int c){
  while(b%c!==0){
     int a=b%c;
      b=c;
      c=a;
    }
  return c;
}
int main(){
 int n;
  cin >> n;
 long long 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,gcd(j,k));
		}		
   	}
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:4:14: error: expected primary-expression before '=' token
    4 |   while(b%c!==0){
      |              ^
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<map>
#include<utility>
#include<string>
#include<unordered_map>
#include<queue>

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

using namespace std;

#define min_3(a, b, c) min(a, min(b, c))
#define max_3(a, b, c) max(a, max(b, c))
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e9+7;

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

int main(){
   int k; cin >> k;
   ll sum = 0;
   for(int i = 1; i <= k; i++) line[i] = i;
   for(int a = 1; a <= k; a++){
      for(int b = 1; b <= k; k++){
         for(int c = 1; c <= k; c++){
            sum += gcd(gcd(a,b),c);
         }
      }
   }
   cout << sum << endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: 'line' was not declared in this scope
   33 |    for(int i = 1; i <= k; i++) line[i] = i;
      |                                ^~~~
Language: C

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>
#include <set>
#include <map>
#include <list>

using ll = long long;
using ld = long double;
using namespace std;
const int INF = 1e9+100;
const ll INF64 = 7e18l;
const int mod = 1000000007;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(), (a).end()
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

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


int main(){
    FIN;
    int K;  cin >> K;

    ll 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(gcd(a,b),c);
            }
        }
    }

    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 <iostream>
#include <algorithm>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:43: error: no matching function for call to '__gcd(int&, int&, int&)'
   12 |                                 a += __gcd(i, j, n);
      |                                      ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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 <iostream>
#include <algorithm>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: 'gcd' was not declared in this scope
   12 |                                 a += gcd(i, j, n);
      |                                      ^~~
Language: C++

#include<stdio.h>
#include <string.h>
#include<iostream>
using namespace std;
 
int main()
{
    int N;
  int sum=0;
  	cin>>N;
 
    for(int i=0;i<N;i++){
       for(int j=0;j<N;j++){
          	for(int k=0;k<N;k++){
              int g;
              g=gcd(i,j);
			  sum+=gcd(k,g);
    }}}
  
	cout<<sum<<endl;
  
    return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'gcd' was not declared in this scope
   16 |               g=gcd(i,j);
      |                 ^~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)


int main() {
	int n,k; long long ans=0;
	string s;
	cin>>k;
	for(int i=1;i<=k;i++){
	    for(int i2=1;i2<=k;i2++){
	        for(int i3=1;i3<=k;i3++){
	            ans+=gcd(i,gcd(i2,i3));
	        }
	    }
	}
	cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: 'gcd' was not declared in this scope
   17 |                     ans+=gcd(i,gcd(i2,i3));
      |                                ^~~
a.cc:17:26: error: 'gcd' was not declared in this scope
   17 |                     ans+=gcd(i,gcd(i2,i3));
      |                          ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
int64_t getgcd(int64_t n, int64_t m)
{
  int64_t r;
  if (n > m)
  {
    int64_t t = m;
    m = n;
    n = t;
  }
  while ((r = m % n) != 0)
  {
    m = n;
    n = r;
  }
  return n;
}
int main()
{
  int64_t k;
  cin >> k;
  int64_t gcd;
  int64_t ans;
  vector<int64_t> z(1);
  vector<int64_t> vecA(k);
  vector<int64_t> vecB(k);
  vector<int64_t> vecC(k);
  for (int i = 0; i < k; i++)
  {
    vecA.at(i) = i + 1;
    vecB.at(i) = i + 1;
    vecC.at(i) = i + 1;
  }

  for (int64_t i = 0; i < k; i++)
  {
    for (int64_t j = 0; j < k; j++)
    {
      for (int64_t l = 0; l < k; l++)
      {
        gcd = getgcd(getgcd(vecA.at(i), vecB.at(j)), vecC.at(l));
        ans += gcd;
      }
    }
    z.at(0) = ans;
  }
  cout << z.at(0) << 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 main() {
	int k = 0;
	cin >> k;
	int a = 0;
	for(int i = 1; i <= k; i++ )
		for(int j = 1; j <= k; j++)
			for (int n = 1; n <= k; n++) {
				a += gcd(i, j, n);
			}
	cout << a << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:38: error: 'gcd' was not declared in this scope
   11 |                                 a += gcd(i, j, n);
      |                                      ^~~
Language: C++

#include<stdio.h>
#include <string.h>
#include<iostream>
using namespace std;
 
int main()
{
    int N;
  int sum=0;
  	cin>>N;
 
    for(int i=0;i<N;i++){
       for(int j=0;j<N;j++){
          	for(int k=0;k<N;k++){
              int g;
              g=gcd(i,j);
			  sum+=gcd(k,g);
    }}}
  
	cout<<sum<<endl;
  
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'gcd' was not declared in this scope
   16 |               g=gcd(i,j);
      |                 ^~~
Language: C

import math
k = int(input())
 
sum = 0
for x1 in range(1,k+1):
  for x2 in range(1,k+1):
    for x3 in range(1,k+1):
      for i in range(1, 2):
        ans = math.gcd(x1,x2)
        ans = math.gcd(ans,x3)
        sum += ans
 
print(sum)

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'k'
    2 | k = int(input())
      | ^
Language: C

from math import gcd

k=int(input())

ans=0
for i in range(1,k+1):
  for j in range(1,k+1):
    for l in range(1, k+1):
      t_gcd=gcd(i,j)
      ans+=gcd(t_gcd,l)

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: C++

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

int main(){

  int n;
  ll ans;
  cin >>n;
  rep(i,n){
    rep(j,n){
      rep(k,n){
        ans += gcd(i,gcd(j,k)));
      }
    }
  }
  
  cout << ans << endl;
  
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected ';' before ')' token
   14 |         ans += gcd(i,gcd(j,k)));
      |                               ^
      |                               ;
Language: C++

#include <iostream>
using namespace std;
int gcm(int b,int c){
  while(b%c==0){
     int a=b%c;
      b=c;
      c=a;
    }
  return c;
}
int main(){
 int n;
  cin >> n;
  int gcm[201]={};
 long long int ans = 0;
  for(int i = 1; i <= n; i++){
   for(int j = 1; j <= n; j++){
    for(int k = 1; k <=n; k++){
   int a,b,c;
   a = i;b=j;c=k;
      ans+=gcm(a,gcm(b,c));
		}		
   	}
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: 'gcm' cannot be used as a function
   21 |       ans+=gcm(a,gcm(b,c));
      |                  ~~~^~~~~
a.cc:21:26: error: 'gcm' cannot be used as a function
   21 |       ans+=gcm(a,gcm(b,c));
      |                          ^
Language: C++

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

int main(){
  int K;
  int i, j, l, m;
  int ans = 0;
  
  cin >> K;

  for(i=1; i <=K; i++){
    for(j=1; j < =K; j++){
      for(l=1; l < =K; l++){
        ans += gcd(gcd(i, j), l);
      }
    }
  }

  cout << ans;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected primary-expression before '=' token
   12 |     for(j=1; j < =K; j++){
      |                  ^
a.cc:13:20: error: expected primary-expression before '=' token
   13 |       for(l=1; l < =K; l++){
      |                    ^
Language: C

from math import gcd
N = int(input())
sum = 0
for i in range(1, N+1):
    for j in range(1, N+1):
        for k in range(1, N+1):
            sum += gcd(i, gcd(j, k))
print(sum)
            


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: C++

#include <bits/stdc++.h>
using namespace std;
int yaku(int &a, int &b)
{int hozon = 1;
  int wari =1;
  for(int i=0;i<max(a,b);i++){
  
  int c = a;
  int d = b;
  a/=wari;
  a*=wari;
  b/=wari;
  b*=wari;
  if(a==c&&b==d)
  {hozon=wari;}
  wari++;}
 return hozon;
  
}
int main() {
  int n;
  cin >> n ;
  int total = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1;j<=n;j++){
      for(int k = 1;k<=n;k++){
        n = yaku(i,yaku(j,k));
        total+= n;}
    }
  }
          
    
      
  cout << total <<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   27 |         n = yaku(i,yaku(j,k));
      |                    ~~~~^~~~~
a.cc:3:23: note:   initializing argument 2 of 'int yaku(int&, int&)'
    3 | int yaku(int &a, int &b)
      |                  ~~~~~^
Language: C++

#include<iostream>

#include<string>

#define ll long long 

#include<vector>

using namespace std;

/*int gcd(int a,int b){

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

}*/

int main(){

  ll n;

  cin>>n;

  ll sum=0;

  for(int i=1;i<=n;i++){

  	  

	  for(int j=1;j<=n;j++){

  	  	int gcv=__gcd(i,j);

  	  	

  	  	for(int k=1;k<=n;k++){

  	  		sum+=__gcd(gcv,k);

  	  	}

	  }

  }

  cout<<sum;

   	 	 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:25: error: '__gcd' was not declared in this scope
   31 |                 int gcv=__gcd(i,j);
      |                         ^~~~~
Language: C

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

namespace C_ABC162
{
    class MainClass
    {

        static int[] s;
        static long[,] g = new long[201, 201];
        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            long sum = 0;
            for (int i = 1; i <= s[0]; i++)
            {
                for (int j = 1; j <= s[0]; j++)
                {
                    for (int k = 1; k <= s[0]; k++)
                    {
                        sum += Gcd(i, Gcd(j, k));



                    }
                }
            }

            WriteLine(sum);
        }
        public static long Gcd(long a, long b)
        {
            if (g[a, b] != 0)
            {
                return g[a, b];
            }
            long tmp;
            // a<bにする
            if (a >= b)
            {
                tmp = a;
                a = b;
                b = tmp;
            }

            if (a == 0)
            {
                g[a, b] = b;
                return b;
            }

            tmp = a;
            a = b % a;
            b = tmp;
            g[a, b] = Gcd(a, b);
            return g[a, b];

        }
    }
}


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

#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2000000007
#define LINF 100000000000000007
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 0
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long ll;
typedef pair<int,int> P;
struct edge{int to,cost;};
int ceil2(int a,int b){if(a%b){return a/b+1;}else{return a/b;}}
using namespace std;

int n,m,ans;
//最大公約数
ll gcd(ll a,ll b){
    
    if(a==0 || b==0)return 0;
    if(a<b){
        ll sw;
        sw=a;
        a=b;
        b=sw;
    }
    
    ll r;
    while((r=a%b)!=0){
        a=b;
        b=r;
    }
    return b;
}
//最小公倍数
ll lcm(ll a,ll b){


    if(a==0 || b==0)return 0;

    return a/gcd(a,b)*b;

}
signed main(){
	cin>>n;
	rep(i,n)rep(j,n)rep(k,n){
		ans+=gcd(i+1,gcd(j+1,k+1));
		//cout<<i+1<<" "<<j+1<<" "<<k+1<<":"<<gcd(i+1,gcd(j+1,n+1))<<endl;
	}
	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 <bits/stdc++.h>
using namespace std;
int gcd (int a, int b) {
    while (b) {
        a %= b;
        swap(a, b);
    }
    return a;
}
int main()
{
	int k;
    cin>>k;
    int sum=0;
    for(int i=1;i<=k;i++)
    {
        for(int j=1;j<=k;j++)
        {
            for(int r=1;r<=k;r++)
            {
                sum+=gcd(i,gcd(j,r));
            }
        }
    }
    cout<<sum<<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 <iostream>
#include <bits/stdc++.h>
using namespace std;

int getgcd(int n, int m){
    int r;
    if(n > m){
        int t = m;
        m = n;
        n = t;
    }
    while((r = m % n) != 0){
        m = n;
        n = r;
    }
    return n;
}



int main(){
    int k;
    long 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 = ans + getgcd(getgcd(i,j),l);
            }
        }
    }
    cout << ans << "\n";
    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, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair<int, int> pii;  // pair<int, int> に pii という別名を付ける
typedef long long ll;

//ユークリッド
int gcd(int a, int b){
  if(a%b == 0){
    return b;
  }
  else{
    int large;
    int small;
    //compare
    large = max(a,b);
    small = min(a,b);
    //calculate, set next a, b
    a = small;
    b = large%small;
    return gcd(max(a,b), min(a,b));
  }
}
int comb(int K){
  int ans = K*K(K-1)/(K*(K-1)/2);
  return ans;
}

int dict(int N, int ans){
  int a, b;
  a = N;
  b = N;
  ans = 0;
  for (int i = 1; i < N*N*N+1; i++){
    if(a != b){
      ans = ans + gcd(a,b) * comb(N);
    }
    cout << a << "," << b << endl;
    cout << "ans" << ans << endl;
    b--;
    if(b == 0){
      a--;
      b = a;
    }
    if(b == 0){
      return i, ans;
    }
  }

  return 0;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  int ans = 0;
  cin >> N;
//  cout << gcd(N, S) << endl;
  cout << dict(N, ans) << endl;
}

Compiler output:
a.cc: In function 'int comb(int)':
a.cc:27:16: error: 'K' cannot be used as a function
   27 |   int ans = K*K(K-1)/(K*(K-1)/2);
      |               ~^~~~~
Language: C++

#pragma GCC optimize("Ofast")
  
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <unordered_set>
#include <list>
#include <tuple>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <cassert>
#include <numeric>
#include <cmath>
#include <bitset>
#include <random>
#include <regex>

using namespace std;
  
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(14)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9+7; 
constexpr int mod2 = 998244353;
constexpr int dy[] = {0,1,0,-1,1,-1,-1,1};
constexpr int dx[] = {1,0,-1,0,1,1,-1,-1};
 
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class A, class B> inline A updiv(const A a,const B b){ return (a + b - 1) / b; }
template <class A, class B> inline A gcd(const A a,const B b){ return b ? gcd(b,a % b) : a; }
template <class A, class B> inline A lcm(const A a,const B b){ return a / gcd(a,b) * b; }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A,class B> using umap = unordered_map<A,B>;


signed main(void){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int k;
    cin >> k;

    int res = 0;

    reps(i,k){
        reps(j,k){
            reps(l,k){
                res += gcd(i,gcd(j,l));
            }
        }
    }

    cout << res << '\n';

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:33: error: call of overloaded 'gcd(int64_t&, int64_t&)' is ambiguous
   66 |                 res += gcd(i,gcd(j,l));
      |                              ~~~^~~~~
a.cc:46:38: note: candidate: 'A gcd(A, B) [with A = long int; B = long int]'
   46 | template <class A, class B> inline A gcd(const A a,const B b){ return b ? gcd(b,a % b) : a; }
      |                                      ^~~
In file included from a.cc:21:
/usr/include/c++/14/numeric:173:5: note: candidate: 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long int; _Nn = long int; common_type_t<_Mn, _Nn> = long int]'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
Language: C++

#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;

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

int main(){
  int k,a,b,c;
  cin>>k;
  for(int a=0;a<k;a++){
    for(int b=0;b<k;b++){
      for(int c=0;c<k;c++){
    gcd(gcd(a,b),c)
      } 
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: expected ';' before '}' token
   26 |     gcd(gcd(a,b),c)
      |                    ^
      |                    ;
   27 |       }
      |       ~
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
const int inf = 1 << 30;
const ll linf = 1e18;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

int K;
ll sum;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> K;
    for(int i = 1; i <= K; i++){
        for(int j = 1; j <= K; j++){
            for(int k = 1; k <= K; k++){
                int g = __gcd(i, j);
                g = __gcd(g, k);
                sum += g;
            }
        }
    }
    cout << sum << endl;
    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 <bits/stdc++.h>
using namespace std;
  int main(){
  int N;
  int a=1;
  int b=1;
  int c=1;
  cin>>N;
  int M=N
  int S=0
  vector<int> v{a,b,c}
  for(int i=0;i<N;i++){
    a++;
    for(int j=0;j<N;j++){
      b++;
      for(int k=0;k<N;k++){
        c++;
        while(true){
          if(v.at(0)%M==0 && v.at(1)%M==0 && v.at(0)%M==0)
            S+=M;
          break;}
          
            M--;
      }}}
          
    
  }
  cout<<S<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'int'
   10 |   int S=0
      |   ^~~
a.cc:19:14: error: 'v' was not declared in this scope
   19 |           if(v.at(0)%M==0 && v.at(1)%M==0 && v.at(0)%M==0)
      |              ^
a.cc:20:13: error: 'S' was not declared in this scope
   20 |             S+=M;
      |             ^
a.cc: At global scope:
a.cc:28:3: error: 'cout' does not name a type
   28 |   cout<<S<<endl;
      |   ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
//#include <bits/stdc++.h>
using namespace std;
long int gcd(int a,int b,int c){
    int s=min(a,b,c);
    for (int x=1;x<=a;x++){
        if (b%(a+1-x)==0&&c%(a+1-x)==0){
            return a+1-x;
            break;
    }
    return 1;
}


int main(){
    long int K;
    int s=0;
    cin>>K;
    for (int i=1;i<=K;i++){
        for (int j=i;j<=K;j++){
            for (int k=j;k<=K;k++){
                if (i==j&&j==k){
                    sum+=gcd(i,j,k);
                }
                else if (i==j) sum+=3*gcd(i,j,k);
                else if (j==k) sum+=3*gcd(i,j,k);
                else sum+=6*gcd(i,j,k);
            }
        }
    }
    cout<<sum<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'long int gcd(int, int, int)':
a.cc:19:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   19 | int main(){
      |         ^~
a.cc:19:9: note: remove parentheses to default-initialize a variable
   19 | int main(){
      |         ^~
      |         --
a.cc:19:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:19:11: error: a function-definition is not allowed here before '{' token
   19 | int main(){
      |           ^
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:8:32: note: to match this '{'
    8 | long int gcd(int a,int b,int c){
      |                                ^
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: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:14:   required from here
    9 |     int s=min(a,b,c);
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
a.cc:37:2: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      |  ^
Language: C

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
ans = 0


def gcd(a,b):
    dv = 2
    c = a
    while a > 1:
        if b%c==0:
            return a
        if a%dv == 0:
            c = a//dv
        dv +=1
    return 1




dp = [[0]*(n+1) for i in range(n+1)]
for i in range(1,n):
    for j in range(i+1,n+1):
        dp[i][j] = gcd(i,j)

for i in range(1,n+1):
    dp[i][i] = i




if n == 1:
    print(1)

else:
    sl = []
    for i in range(2,n+1):
        for j in range(2,i):
            if i%j == 0:
                break
        else:
            sl.append(i)
        
    for i in range(1,n+1):
        for j in range(i,n+1):
            bv = dp[i][j]
            if i == j:
                seki = 3
            else:
                seki = 6

            for k in range(j,n+1):
                if i == j == k: continue
                
                elif i==k or j == k:
                    ans += dp[bv][k] * 3
                    # ans = gcd(bv,k) * 3
                else:
                    ans += dp[bv][k] * seki
                    # ans = gcd(bv,k) * seki
                # print(i,j,k,ans)
    for i in range(1,n+1):
        ans += i

    print(ans)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | ii = lambda : int(input())
      | ^~
main.c:1:1: error: type defaults to 'int' in declaration of 'ii' [-Wimplicit-int]
main.c:1:6: error: 'lambda' undeclared here (not in a function)
    1 | ii = lambda : int(input())
      |      ^~~~~~
main.c:1:13: error: expected ',' or ';' before ':' token
    1 | ii = lambda : int(input())
      |             ^
main.c:59:23: error: invalid preprocessing directive #ans
   59 |                     # ans = gcd(bv,k) * 3
      |                       ^~~
main.c:62:23: error: invalid preprocessing directive #ans
   62 |                     # ans = gcd(bv,k) * seki
      |                       ^~~
main.c:63:19: error: invalid preprocessing directive #print
   63 |                 # print(i,j,k,ans)
      |                   ^~~~~
Language: C++

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


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

    //nの約数の数え上げ
    vector<int> a;
    for(int i = 2; i <= n; i++){
        if(n%i ==0 ){
            a.push_back(i);
        }
    }

    //sumに計算途中の最大公約数を足していく
    int sum = 0;
    //cntで1以外の最大公約数がいくつあったか数える
    int cnt = 0;

    //nの各約数について最大公約数を探していく
    for(int i = 0; i < a.size(); i++){
        //kは、nの約数がnに収まる範囲内で何倍までしていいかの限界値
        int k = n / a.at(i);
        //nの約数を自然数倍してできる数を数える
        for(int j = 1; j * a.at(i) <= n; j++){
            cnt += 3 * k * k - 2;
            sum += j * a.at(i) *cnt;
            k--;
        }

    }
    cout << k*k*k + sum -cnt <<endl;

    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'k' was not declared in this scope
   35 |     cout << k*k*k + sum -cnt <<endl;
      |             ^
Language: C

k = int(input())

total = 0

def gcd(a, b):
    if b == 0:
        return a
    else:
        q, r = divmod(a, b)
        return gcd(q, r)

for i in range(1, k+1):
    for j in range(1, k+1):
        total += gcd(i, j)
print(total*k+1)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | k = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | k = int(input())
      |     ^~~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int k; scanf("%d",&n);
	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(gcd(a,b),c);
	printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 'n' was not declared in this scope
    8 |         int k; scanf("%d",&n);
      |                            ^
Language: C

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

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

int main() {
    // 前処理
    COMinit();

    ll N,K;cin>>N>>K;

    //悲しいなあできると思ったんですけど


}


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

#include <iostream>
namespace std;
  template <class M, class N>
  constexpr common_type_t<M, N> gcd(M m, N n);

  template <class M, class N>
  constexpr common_type_t<M, N> lcm(M m, N n);

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

  for (int i = 1; i <= K; i++) {

    for (int i = 1; i <= K; i++) { 

      for (int i = 1; i <= K; i++) {
    
      }
    }
  }
}

Compiler output:
a.cc:2:14: error: expected '{' before ';' token
    2 | namespace std;
      |              ^
a.cc:4:13: error: 'common_type_t' does not name a type
    4 |   constexpr common_type_t<M, N> gcd(M m, N n);
      |             ^~~~~~~~~~~~~
a.cc:7:13: error: 'common_type_t' does not name a type
    7 |   constexpr common_type_t<M, N> lcm(M m, N n);
      |             ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |   cin >> K;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <iostream>
using namespace std;

void gcd(int x,int y){
	int r;
   if(x<y)swap(x,y);
  
  while(y>0){
  r = x%y;
  x = y;
  y = r;
  }
  return x;
}

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





Compiler output:
a.cc: In function 'void gcd(int, int)':
a.cc:15:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   15 |   return x;
      |          ^
a.cc: In function 'int main()':
a.cc:29:22: error: invalid use of void expression
   29 |          sum+=gcd(gcd(a,b),c);
      |                   ~~~^~~~~
Language: C

#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
typedef long long ll;
#include <cmath>
#include<cstdio>
#include<iomanip>

int main(int argc, char *argv[])
{
	ll k;

	cin>>k;
	vector<ll> a(k+1);

	ll s=0;
	ll ret=0;
	for (ll i=k;i>0;i--)
	{
		ll n=k/i;
		ll n3=n*n*n;
		for (ll j=2;i*j<=k;j++)
		{
			n3-=a[i*j];
		}
		a[i]=n3;
		//cerr<<i<<" "<<n3<<endl;
		ret+=n3*i;
		s+=n3;
	}
	cerr<<s<<endl;

	cout<<ret<<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 endl '\n'
using namespace std;
long long GCD(long long x,long long y) {
    while (x==0||y==0) {
        if (x>y) x %= y;
        else y %= x;
    }
    if (x==0) return y;
    else return x;

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

Compiler output:
a.cc: In function 'long long int GCD(long long int, long long int)':
a.cc:12:10: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   12 | int main () {
      |          ^~
a.cc:12:10: note: remove parentheses to default-initialize a variable
   12 | int main () {
      |          ^~
      |          --
a.cc:12:10: note: or replace parentheses with braces to value-initialize a variable
a.cc:12:13: error: a function-definition is not allowed here before '{' token
   12 | int main () {
      |             ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:40: note: to match this '{'
    4 | long long GCD(long long x,long long y) {
      |                                        ^
Language: C

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

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

  for (int i = 1; i < k + 1; i++) {
    for (int j = 1; j < k + 1; j++) {
      for (int n = 1; n < k + 1; n++) {
        sum += gcd(i, (gcd(j, n)));
      }
    }
  }

  cout << sum << endl;

}

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


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 gcd(int a,int b){
  
  for(int i=0;true;i++){
    b %= a%b;
  
  if( a%b == 0 ){
    return b;}
  }
}
      
int main(){
  int K,sum=0,gcd=0;
  cin >> K;
  
  for(int a=1; a<=K ; a++){
    for(int b=1; b<=K ; b++){
      for(int c=1; c<=K ; c++){
        
        int gcd = gcd(a,gcd(b,c));
        
        sum += gcd;}
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: 'gcd' cannot be used as a function
   22 |         int gcd = gcd(a,gcd(b,c));
      |                         ~~~^~~~~
a.cc:22:33: error: 'gcd' cannot be used as a function
   22 |         int gcd = gcd(a,gcd(b,c));
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,sum=0;
  	cin >> n;
  	for(int i=1;i<n+1;i++)
    {
      for(int j=1;j<n+1;j++)
      {
        for(int k=1;k<n+1;k++)
        {
          sum += gcd(i,j,k);
        }
      }
    }
  	cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:21: error: no matching function for call to 'gcd(int&, int&, int&)'
   13 |           sum += gcd(i,j,k);
      |                  ~~~^~~~~~~
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: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/14/numeric:173:5: note:   candidate expects 2 arguments, 3 provided
Language: C++

#include <stdio.h>
#include <algorithm>
#include <iostream>
using namespace std;

void gcd(int x,int y){
	int r;
   if(x<y)swap(x,y);
  
  while(y>0){
  r = x%y;
  x = y;
  y = r;
  }
  return x;
}

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


Compiler output:
a.cc: In function 'void gcd(int, int)':
a.cc:15:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   15 |   return x;
      |          ^
a.cc: In function 'int main()':
a.cc:20:2: error: expected initializer before 'int'
   20 |  int K;
      |  ^~~
a.cc:22:7: error: 'K' was not declared in this scope
   22 |  cin>>K;
      |       ^
a.cc:28:10: error: 'c' was not declared in this scope
   28 |          c=k;
      |          ^
a.cc:29:22: error: invalid use of void expression
   29 |          sum+=gcd(gcd(a,b),c);
      |                   ~~~^~~~~
Language: C++

#include<bits.stdc++.h>
using namespace std;
int main()
{
	int n,sum=0;
  	cin >> n;
  	for(int i=1;i<n+1;i++)
    {
      for(int j=1;j<n+1;j++)
      {
        for(int k=1;k<n+1;k++)
        {
          sum += gcd(i,j,k);
        }
      }
    }
  	cout << sum;
}

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