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

#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
using ll = long long;
int main() {
  ll n, k;
  cin >> n >> k;
  if ((n % k) == 0) {
    cout << "0";
    exit(0);
  }
  else {
    cout << min(n % k, abs(n % k - k));
  }

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

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

int main() {
  int N,K;
  cin >> N >> K;
  int r;
  r = N % K;
  if (r == 0) cout << 0 << endl;
  else 
  cout << min(r, K-r) << endl;
  }
}

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

#include <iostream>

typedef long long ll

int main () {
	ll N, K;
	cin >> N >> K;
	ll x = N % K;
	if (K-x < x)
		x = K-x;

	cout << x << endl;
	return 0;
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main () {
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  unsinged long long int a,b,c;
  cin>>a>>b;
  c=a-b;
  cout<<(b-c)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
    5 |   unsinged long long int a,b,c;
      |   ^~~~~~~~
      |   unsigned
a.cc:6:8: error: 'a' was not declared in this scope
    6 |   cin>>a>>b;
      |        ^
a.cc:6:11: error: 'b' was not declared in this scope
    6 |   cin>>a>>b;
      |           ^
a.cc:7:3: error: 'c' was not declared in this scope
    7 |   c=a-b;
      |   ^
Language: Java

import java.util.*;
class Main {
    public static int gcd(long n, int k) {
        if(n == 0) {
            return k;
        }
        if(k == 0) {
            return (int)n;
        }
        if(n > k) {
            return gcd((long)n-k, k);
        }
        else {
            return gcd(n, (int)k-n);
        }
    }
    public static void main(String []args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int k = sc.nextInt();

        if(n % k == 0) {
            System.out.println(0);
        }
        else {
            System.out.println(gcd(n, k));
        }
    }
}

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from long to int
            return gcd(n, (int)k-n);
                                ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;
class Main {
    public static int gcd(long n, int k) {
        if(n == 0) {
            return k;
        }
        if(k == 0) {
            return (int)n;
        }
        if(a > b) {
            return gcd((long)n-k, k);
        }
        else {
            return gcd(n, (int)k-n);
        }
    }
    public static void main(String []args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        int k = sc.nextInt();

        if(n % k == 0) {
            System.out.println(0);
        }
        else {
            System.out.println(gcd(n, k));
        }
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
        if(a > b) {
           ^
  symbol:   variable a
  location: class Main
Main.java:10: error: cannot find symbol
        if(a > b) {
               ^
  symbol:   variable b
  location: class Main
Main.java:14: error: incompatible types: possible lossy conversion from long to int
            return gcd(n, (int)k-n);
                                ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  long long int N, K;
  long long int MIN;
 
  cin >> N >> K;
  
  if(N == K){
    cout << 0 << endl;
    return 0;
  }else if(N > K){
    MIN = N % K;
    cout << min(MIN, abs(MIN - K) << endl;
    return 0;
  }else{
    cout << min(N, abs(N - K)) << endl;
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |     cout << min(MIN, abs(MIN - K) << endl;
      |                      ~~~~~~~~~~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  long long int N, K;
  long long int MIN;
 
  cin >> N >> K;
  
  if(N == K){
    cout << 0 << endl;
    return 0;
  }else if(N > K){
    min = N % K;
    cout << min(MIN, abs(MIN - K)
  }else{
    cout << min(N, abs(N - K) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: overloaded function with no contextual type information
   14 |     min = N % K;
      |               ^
a.cc:15:34: error: expected ')' before '}' token
   15 |     cout << min(MIN, abs(MIN - K)
      |                ~                 ^
      |                                  )
   16 |   }else{
      |   ~                               
a.cc:17:31: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |     cout << min(N, abs(N - K) << endl;
      |                    ~~~~~~~~~~~^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  long long int N, K;
  long long int min;
  long long int ans;

  cin >> N >> K;
  ans = N;

    if (N > K){
      do{
        min = ans;
        ans = 0;

        if (min > K){
          ans = min % K;
        } else{
          ans = K % min;
        }
        if (ans == 1 || ans == 0){
          min = ans;
          break;
        }
      } while(ans < min);
    }

    if (N < K){
      do{
        min = ans;
        ans = 0;

        if (min > K){
          ans = min - K;
        } else{
          ans = K - min;
        }
        if (ans == 1 || ans == 0){
          min = ans;
          break;
        }
      } while(ans < min);
    }
    }


  cout << min << endl;

  return 0;
}


Compiler output:
a.cc:48:3: error: 'cout' does not name a type
   48 |   cout << min << endl;
      |   ^~~~
a.cc:50:3: error: expected unqualified-id before 'return'
   50 |   return 0;
      |   ^~~~~~
a.cc:51:1: error: expected declaration before '}' token
   51 | }
      | ^
Language: C++

#include<bits/stdc++>
using namespace std;
 
int main(){
  long long int N, K;
  long long int MIN;
 
  cin >> N >> K;
  
  if(N == K){
    cout << 0 << endl;
    return 0;
  }else if(N > K){
    min = N % K;
    cout << min(MIN, abs(MIN - K)
  }else{
    cout << min(N, abs(N - K) << endl;
  }
}

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

#include<iostream>
using namespace std;
 
int main(){
  long long int N, K;
  long long int MIN;
 
  cin >> N >> K;
  
  if(N == K){
    cout << 0 << endl;
    return 0;
  }else if(N > K){
    min = N % K;
    cout << min(MIN, abs(MIN - K)
  }else{
    cout << min(N, abs(N - K) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: overloaded function with no contextual type information
   14 |     min = N % K;
      |               ^
a.cc:15:34: error: expected ')' before '}' token
   15 |     cout << min(MIN, abs(MIN - K)
      |                ~                 ^
      |                                  )
   16 |   }else{
      |   ~                               
a.cc:17:31: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |     cout << min(N, abs(N - K) << endl;
      |                    ~~~~~~~~~~~^~~~~~~
Language: C++

v#include<bits/stdc++.h>

using namespace std;

long long n, k;

int main(){
	cin >> n >> k;
	long long t = n % k;
	cout  << min(t, k-t) << endl;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> n >> k;
      |         ^~~
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout  << min(t, k-t) << endl;
      |         ^~~~
a.cc:10:18: error: 'min' was not declared in this scope; did you mean 'main'?
   10 |         cout  << min(t, k-t) << endl;
      |                  ^~~
      |                  main
a.cc:10:33: error: 'endl' was not declared in this scope
   10 |         cout  << min(t, k-t) << endl;
      |                                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define forn(i,n) for(ll i=0; i<(n); i++)
#define fori(i,k,n) for(ll i=k; i<(n); i++) 
 
int t;
 
void solve(){
	ll n, k;
	cin >> n >> k;
	if(k == 1){
		cout << 0;
		break;
	}
	n %= k;
	if(k-1 == n) {
		cout << 1;
		break;
	}
	cout << min(n, k-n);
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	t = 1;
	while(t--)
		solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:18:17: error: break statement not within loop or switch
   18 |                 break;
      |                 ^~~~~
a.cc:23:17: error: break statement not within loop or switch
   23 |                 break;
      |                 ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define forn(i,n) for(ll i=0; i<(n); i++)
#define fori(i,k,n) for(ll i=k; i<(n); i++) 
 
int t;
 
int solve(){
	ll n, k;
	cin >> n >> k;
  	n %= kl
	return min(k-n, n);
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << solve() << "\n";
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:16:14: error: 'kl' was not declared in this scope; did you mean 'k'?
   16 |         n %= kl
      |              ^~
      |              k
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include<iostream>
#include <cstdlib>

using namespace std;

int main()
{
  int x ,t, n;
  cin>>x>>>n;
  while(n<0){
  t=abs(x-n);
  x=t;
  }
  cout<<n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before '>' token
    9 |   cin>>x>>>n;
      |           ^
Language: C++

 #include <iostream>
#include<string>
#include<algorithm>
#include<cmath>

using namespace std;

int main() {
	//code
	int tc;  
     int i,j,k,n,m,p=0;
      cin>>n>>k;
	 cout<<min(n%k,abs((n%k)-k)<<endl;
    
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   13 |          cout<<min(n%k,abs((n%k)-k)<<endl;
      |                        ~~~~~~~~~~~~^~~~~~
Language: Java

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

/* Name of the class has to be "Main" only if the class is public. */
public class codeforces
{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(next());
        }
        long nextLong(){
            return Long.parseLong(next());
        }
        double nextDouble(){
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            } catch (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
  public static void main(String[] args)throws Exception{
    FastReader in = new FastReader();
    long n = in.nextLong(), k = in.nextLong();
    long prev = n;
    while(true){
        long newValue = Math.abs(prev - k);
        if(prev < newValue){
            break;
        }
        prev = newValue;
    }
    System.out.println(prev);
  }
}

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

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

/* Name of the class has to be "Main" only if the class is public. */
public class codeforces
{
    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next(){
            while(st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt(){
            return Integer.parseInt(next());
        }
        long nextLong(){
            return Long.parseLong(next());
        }
        double nextDouble(){
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            } catch (Exception e){
                e.printStackTrace();
            }
            return str;
        }
    }
  public static void main(String[] args)throws Exception{
    FastReader in = new FastReader();
    long n = in.nextLong(), k = in.nextLong();
    long prev = n;
    while(true){
        long newValue = Math.abs(prev - k);
        if(prev < newValue){
            break;
        }
        prev = newValue;
    }
    System.out.println(prev);
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.lang.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class codeforces
      | ^~~~~~
Language: C++

#include<bits/stdc++>

using namespace std;

int main(){
int i, N, K;

cin >> N >> K;
while(abs(N-K)>abs(N)){
N = abs(N-K);
}
cout >> N;
return 0;

}

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

#include<bits/stdc++.h>
 
using namespace std;
int MOD(int a){
if(a>0)
  return a;
else 
  return (-1)*a;
}
void main(){
  int n,m,k;
  cin>>n>>m;
  if(n%m==0){
    cout<<"0";
    return;
  }
  
  while(true){
    k=n;
    n=MOD(n-m);
    if(n>=k)
      break;
  }
  cout<<k;
}

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

#include<bits/stdc++.h>
 
using namespace std;
int MOD(int a){
if(a>0)
  return a;
else 
  return (-1)*a;
}
int main(){
  int n,m,k;
  cin>>n>>m;
  if(n%m==0){
    cout<<"0";
    return;
  }
  
  while(true){
    k=n;
    n=MOD(n-m);
    if(n>=k)
      break;
  }
  cout<<k;
}

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

#include <bits/stdc++.h>
#define N 110
#define pb push_back
#define fi first
#define se second
#define si size()
#define ll long long
#define mp make_pair
#define iter ::iterator
#define all(v) v.begin(), v.end()
#define pp pop_back
#define mapiter map<int, int>::iterator
#define forn(i, n) for(int i = 0; i < n; ++i)
#define forn1(i, n) for(int i = 1; i <= n; ++i)
#define forr(i, n)  for(int i = n - 1; i >= 0; --i)
#define forr1(i, n) for(int i = n; i >= 1; --i)
#define form(l, r, i)   for(int i = l; i <= r; ++i)
#define forv(r, l, i)   for(int i = r; i >= l; --i)
#define r0 return 0
#define barnarnar ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define lld long double
#define elif else if
  
const int inf = 1e9 + 7;
const lld EPS = 0.00000001;
const ll modw = 1e9 + 9;
  
using namespace std;



int main()
{
    barnarnar
    ll n, k;
    cin >> n >> k;
    cout << min(n, min(n % k, k - n % k);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:41: error: expected ')' before ';' token
   37 |     cout << min(n, min(n % k, k - n % k);
      |                ~                        ^
      |                                         )
Language: Java

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

public class Main{

	static int temp=0,n,k;
	public static void main(String args[])throws Exception{
		Scanner sc=new Scanner(System.in);
			 n= sc.nextInt();
			 k= sc.nextInt();

			 replace(n,k);
			}

			static int replace(int n, int k){
				if(n<k)
					return n;
				while(n>=0){
					n=Math.abs(n-k);
				}
				return n;
			}



Compiler output:
Main.java:22: error: reached end of file while parsing
			}
			 ^
1 error
Language: C++

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

int main (){
  ll n, k;
  cin >> n >> k;

  if ( n == 0 and k == 1){
    cout << "1" << endl;
    return;
  }
  if ( k > n){
    cout << n << endl;
    return 0;
  }
  if ( k == n or k == 1  or  n %k == 0){
    cout << "0" << endl;
    return 0;
  }
  if ( n > k){
    n = n %k;
    cout << abs ( n-k ) << endl;
  }
}


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

#include <bits/stdc++.h>

#define pb push_back
#define sp " "
#define fi first
#define se second
#define mp make_pair
#define sz(a) ((int)a.size())
#define tra(a,b) for (auto a:b) 
#define fo(a,b,c) for (unsigned long long a=b;a<=c;a++) 
#define ms(a,b) memset(a,b,sizeof(a)) 
#define all(a) a.begin(),a.end()
#define rev(a) reverse(a.begin(),a.end())
#define bit(i,j) (i&(1<<j))
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef pair<int,ii> iii;

const int N=2e5+5,mod=998244353;
ll a,b;

int main()
{
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	cin>>a>>b;
	a%=b;
	int r=a;
	r=min(r,b-a);
	cout<<r;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: no matching function for call to 'min(int&, ll)'
   32 |         r=min(r,b-a);
      |           ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:32:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   32 |         r=min(r,b-a);
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:32:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   32 |         r=min(r,b-a);
      |           ~~~^~~~~~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;

int main()
{
	unsigned long long int n,k,n1;
	cin>>n>>k;
	n1=n;
	while(n>=0)
	{
		n=n-k;
	}
	n=abs(n);
	if(n>n1)
	{
		cout<<n1;
	}
	else cout<<n;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: call of overloaded 'abs(long long unsigned int&)' is ambiguous
   14 |         n=abs(n);
      |           ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int gcd(long long n,long long k){
  while(k){
    n%=k;
  swap(n,k);
  }
  return n;
}
int main(){
long long n,k;
  cin>>n>>k;
  if(n==k||n%k==0||n==0||k==1){
    cout<<"0";
    return;
  } else if(n==1&&k>1){
   cout<<"1";
    return;
  }else if(k%n==0){
   cout<<n;
   return;
 }else{
    
    cout<<gcd(n,k);
    return;
  }
  return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  long long int N,K;
  cin>>N>>K;
  vector<long long int> q;
  while(N>K){
	N=abs(N-K);
  }
  cout<<N<<endl;
  return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<long long int> q;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'long'
    6 |   vector<long long int> q;
      |          ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  long long int N,K;
  cin>>N>>K;
  vector<long long int> q;
  while(N>K){
	N=abs(N-k);
  }
  cout<<N<<endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<long long int> q;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'long'
    6 |   vector<long long int> q;
      |          ^~~~
a.cc:8:17: error: 'k' was not declared in this scope
    8 |         N=abs(N-k);
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m;
    scanf("%lld%lld", &n, &m)
    printf("%lld\n", min(n%m,m-(n%m))); 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:30: error: expected ';' before 'printf'
    6 |     scanf("%lld%lld", &n, &m)
      |                              ^
      |                              ;
    7 |     printf("%lld\n", min(n%m,m-(n%m)));
      |     ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, n, ans;
  cin >> N >> K;
  n = N % K;
  ans = min(n, K - n);
  }
  cout << ans << endl;
}

Compiler output:
a.cc:9:3: error: 'cout' does not name a type
    9 |   cout << ans << endl;
      |   ^~~~
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
using namespace std;
typedef pair<int,int> PII;
typedef pair<long,long> PLL;
 
ll n,k;
 
int main() {
    ios::sync_with_stdio(false);
    cin>>n>>k;
     if(n%k==0){
         printf("0\n");
     }
     else{
         printf("%lld\n",min(n%k,k-(n%k));
     }
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:42: error: expected ')' before ';' token
   33 |          printf("%lld\n",min(n%k,k-(n%k));
      |                ~                         ^
      |                                          )
Language: C++

#include<bits/stc++.h>
using namespace std;
int main()
{
  int x,y;

  cout<<min(x%y,y-x%y);
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
  double N, K;
  cin >> N >> K;
  N = N % K;
  while (true) {
    if (N > K / 2) {
      if (N < K) {
        N = K - N;
      }
      else {
        N -= K;
      }
    }
    else {
      cout << N << endl;
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    6 |   N = N % K;
      |       ~ ^ ~
      |       |   |
      |       |   double
      |       double
Language: C++

#include <bits/stdc++.h>

int main()
{
    long long N, K;
    std::cin >> N >> K;

    long long r = N % K;
    long long r_K = abs(r - K);
    //long long ans = std::min(r, r_K);
    long long ans = std::min(r, abs(r - K));
    std::cout << ans << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: no matching function for call to 'min(long long int&, int)'
   11 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:11:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   11 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:11:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   11 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

int main()
{
    long long N, K;
    std::cin >> N >> K;

    long long r = N % K;
    long long r_K = std::min(r, abs(r - K));
    long long ans = std::min(r, r_K);
    std::cout << ans << std::endl;


    // long long pre_n;
    // long long pre_pre_n;
    // pre_pre_n = abs(N - K);
    // pre_n = abs(pre_pre_n - K);

    // long long min_N = std::numeric_limits<long long>::max();
    // while(1)
    // {
    //     long long tgt_n = abs(pre_n - K);
    //     // std::cout << pre_pre_n << ", " << pre_n << ", " << tgt_n << std::endl;

    //     if (tgt_n == pre_pre_n)
    //     {
    //         min_N = std::min(tgt_n, abs(tgt_n - K));
    //         break;
    //     }
    //     else
    //     {
    //         pre_pre_n = pre_n;
    //         pre_n = tgt_n;
    //     }
    // }

    // std::cout << min_N << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: no matching function for call to 'min(long long int&, int)'
    9 |     long long r_K = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:9:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |     long long r_K = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:9:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |     long long r_K = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

int main()
{
    long long N, K;
    std::cin >> N >> K;

    long long r = N % K;
    long long ans = std::min(r, abs(r - K));
    std::cout << ans << std::endl;


    // long long pre_n;
    // long long pre_pre_n;
    // pre_pre_n = abs(N - K);
    // pre_n = abs(pre_pre_n - K);

    // long long min_N = std::numeric_limits<long long>::max();
    // while(1)
    // {
    //     long long tgt_n = abs(pre_n - K);
    //     // std::cout << pre_pre_n << ", " << pre_n << ", " << tgt_n << std::endl;

    //     if (tgt_n == pre_pre_n)
    //     {
    //         min_N = std::min(tgt_n, abs(tgt_n - K));
    //         break;
    //     }
    //     else
    //     {
    //         pre_pre_n = pre_n;
    //         pre_n = tgt_n;
    //     }
    // }

    // std::cout << min_N << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: no matching function for call to 'min(long long int&, int)'
    9 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:9:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:9:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |     long long ans = std::min(r, abs(r - K));
      |                     ~~~~~~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

int main()
{
    long long N, K;
    std::cin >> N >> K;

    long long r = N % K;
    std::cout << std::min(r, abs(r - K)) << std::endl;
    

    // long long pre_n;
    // long long pre_pre_n;
    // pre_pre_n = abs(N - K);
    // pre_n = abs(pre_pre_n - K);

    // long long min_N = std::numeric_limits<long long>::max();
    // while(1)
    // {
    //     long long tgt_n = abs(pre_n - K);
    //     // std::cout << pre_pre_n << ", " << pre_n << ", " << tgt_n << std::endl;

    //     if (tgt_n == pre_pre_n)
    //     {
    //         min_N = std::min(tgt_n, abs(tgt_n - K));
    //         break;
    //     }
    //     else
    //     {
    //         pre_pre_n = pre_n;
    //         pre_n = tgt_n;
    //     }
    // }

    // std::cout << min_N << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: no matching function for call to 'min(long long int&, int)'
    9 |     std::cout << std::min(r, abs(r - K)) << std::endl;
      |                  ~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:9:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    9 |     std::cout << std::min(r, abs(r - K)) << std::endl;
      |                  ~~~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:9:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    9 |     std::cout << std::min(r, abs(r - K)) << std::endl;
      |                  ~~~~~~~~^~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K;
int main(){
  cin >> N >> K;
  ll mod = N%K
  ll ans = abs(K-mod);
  cout << min(mod, ans) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'll'
    8 |   ll ans = abs(K-mod);
      |   ^~
a.cc:9:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout << min(mod, ans) << endl;
      |                    ^~~
      |                    abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K;
int main(){
  cin >> N >> K;
  ll mod = N%K
  ll ans = abs(N-mod);
  cout << min(mod, ans) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'll'
    8 |   ll ans = abs(N-mod);
      |   ^~
a.cc:9:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout << min(mod, ans) << endl;
      |                    ^~~
      |                    abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N, K;
int main(){
  cin >> N >> K;
  ll mod = N%K
  ll ans = abs(N-mod);
  else cout << min(mod, ans) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'll'
    8 |   ll ans = abs(N-mod);
      |   ^~
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else cout << min(mod, ans) << endl;
      |   ^~~~
a.cc:9:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   else cout << min(mod, ans) << endl;
      |                         ^~~
      |                         abs
Language: C++

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

int main() {
  int N,K,n,k,ans;
  cin >> N >> K;
  n=N%K;
  k=K-n
  ans=min(n,k);
  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: expected ';' before 'ans'
    8 |   k=K-n
      |        ^
      |        ;
    9 |   ans=min(n,k);
      |   ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n,k
    cin>>n>>k;
  cout<<min(n%k,k-n%k)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin>>n>>k;
      |     ^~~
a.cc:7:15: error: 'k' was not declared in this scope
    7 |   cout<<min(n%k,k-n%k)<<endl;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin >> n >> k;
    cout << min(n%k,abs((n%k)-k);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:33: error: expected ')' before ';' token
    6 |     cout << min(n%k,abs((n%k)-k);
      |                ~                ^
      |                                 )
Language: C

#include <stdio.h>
#include <math.h>

int main(){
long long int n,k;
  long long int ans;

  scanf("%d%d",&n,&k);
  ans=n%k;
  ans=min(ans,k-ans);
  printf("%lld",ans);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:10:7: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   10 |   ans=min(ans,k-ans);
      |       ^~~
      |       main
Language: C

#include <stdio.h>

int main(){
long long int n,k;
  long long int ans;

  scanf("%d%d",&n,&k);
  ans=n%k;
  ans=min(ans,k-ans);
  printf("%lld",ans);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:9:7: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    9 |   ans=min(ans,k-ans);
      |       ^~~
      |       main
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
//#define _0219nice 
using namespace std;
int main() {
#ifdef _0219nice
    freopen("1.in", "r", stdin);
#endif
    long long n, k;
    while (cin >> n >> k) {
        n %= k;
        cout << min(k - n, n) << endl;
    }
    return 0;
}
~    

Compiler output:
a.cc:17:2: error: expected class-name at end of input
   17 | ~
      |  ^
Language: C++

#include <iostream>
#include <algorithm>
//#define _0219nice 
using namespace std;
int main() {
#ifdef _0219nice
    freopen("1.in", "r", stdin);
#endif
    long long n, k;
    while (cin >> n >> k) {
        n %= k;
        cout << min(k - n, n) << endl;
    }
    return 0;
}
~    

Compiler output:
a.cc:16:2: error: expected class-name at end of input
   16 | ~
      |  ^
Language: C++

#include <algorithm>
#incluide <iostream>
 
using namespace std;
 
int main() {
  long long n, k;
  cin >> n >> k;
  long long mod = n % k;
  cout << min(mod, k - mod) << endl;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #incluide; did you mean #include?
    2 | #incluide <iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n >> k;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <algorithm>
  +++ |+#include <iostream>
    2 | #incluide <iostream>
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << min(mod, k - mod) << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:32: error: 'endl' was not declared in this scope
   10 |   cout << min(mod, k - mod) << endl;
      |                                ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <algorithm>
  +++ |+#include <ostream>
    2 | #incluide <iostream>
Language: C++

#include <algorithm>
#incluide <iostream>

using namespace std;

int main() {
  long long n, k;
  cin >> n >> k;
  long long mod = n % k;
  cout << min(mod, k - mod) << endl;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #incluide; did you mean #include?
    2 | #incluide <iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n >> k;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <algorithm>
  +++ |+#include <iostream>
    2 | #incluide <iostream>
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << min(mod, k - mod) << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:32: error: 'endl' was not declared in this scope
   10 |   cout << min(mod, k - mod) << endl;
      |                                ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <algorithm>
  +++ |+#include <ostream>
    2 | #incluide <iostream>
Language: C++

#include <iostream>

using namespace std;

int main(){
 int N,K;
  cin>>N>>K;
  N %= K;
  if(!N) N = N <  K%N ? N : K%N;
  cout<<N
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected ';' before 'return'
   10 |   cout<<N
      |          ^
      |          ;
   11 |   return 0;
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  ll int n,k;
  cin >> n >> k;
  ll int a=n%k;
  ll int ans=min(a,k-a);
  cout << ans << endl;}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: two or more data types in declaration of 'n'
    5 |   ll int n,k;
      |   ^~
a.cc:5:3: error: two or more data types in declaration of 'k'
a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin >> n >> k;
      |          ^
      |          yn
a.cc:6:15: error: 'k' was not declared in this scope
    6 |   cin >> n >> k;
      |               ^
a.cc:7:3: error: two or more data types in declaration of 'a'
    7 |   ll int a=n%k;
      |   ^~
a.cc:8:3: error: two or more data types in declaration of 'ans'
    8 |   ll int ans=min(a,k-a);
      |   ^~
a.cc:8:18: error: 'a' was not declared in this scope
    8 |   ll int ans=min(a,k-a);
      |                  ^
a.cc:9:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   cout << ans << endl;}
      |           ^~~
      |           abs
Language: C++

#include<iostream>
#include<numeric>
using llong=long long

int main(void){
	llong n, k;
	std::cin >> n >> k;
	std::cout << std::min(n % k, k - n % k) << std::endl;
	return 0;
}


Compiler output:
a.cc:5:4: error: expected ';' before 'main'
    5 | int main(void){
      |    ^~~~~
      |    ;