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

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e18;
const ll mod=1e9+7;

int main(){
    if(k==1) cout << 0 << endl;
    else cout << n-k << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:8: error: 'k' was not declared in this scope
   24 |     if(k==1) cout << 0 << endl;
      |        ^
a.cc:25:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   25 |     else cout << n-k << endl;
      |                  ^
      |                  yn
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
ll n,k;
cin>>n>>k;
if(k==1){
cout << 0 << endl;}
else{
cout << n-k << endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: expected '}' at end of input
   41 | cout << n-k << endl;}
      |                      ^
a.cc:35:12: note: to match this '{'
   35 | int main() {
      |            ^
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  cout << (K == 1) ? 0 : N - K << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
    7 |   cout << (K == 1) ? 0 : N - K << "\n";
      |                          ~~~~~ ^~ ~~~~
      |                            |      |
      |                            int    const char [2]
Language: C++

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

int main() {
  int n, m;
  cin >> n >> m;
  cout << n-(k-1) - 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'k' was not declared in this scope
    7 |   cout << n-(k-1) - 1 << endl;
      |              ^
Language: C++

#include <cstdio>
using namespace std;
int n,k;
int main()
{
  scanf("%d%d",&n,&k):
  if(k==1) printf("0");
  else printf("%d",n-(k-1)-1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected ';' before ':' token
    6 |   scanf("%d%d",&n,&k):
      |                      ^
      |                      ;
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else printf("%d",n-(k-1)-1);
      |   ^~~~
Language: C++

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

int main() {
  int n,k;
  cin >> n >> k;
  if (k==1) {
    cout<< 0 << endl;
  }
  else{
    cout<< n-k << endl;
  }  


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

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,k;
  cin>>n>>k;
  if(k==1){
    cout<<1;
  }
  else{
    cout<<n-k;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:34:14: note: to match this '{'
   34 | signed main(){
      |              ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a%b==0){printf("0");}
else{printf("%d",a-b);}
}

int min(a,b,c){
    return ret;
}

Compiler output:
main.c: In function 'min':
main.c:12:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
   12 | int min(a,b,c){
      |     ^~~
main.c:12:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:12:5: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:13:12: error: 'ret' undeclared (first use in this function)
   13 |     return ret;
      |            ^~~
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a%b==0){printf("%d",0);}
else{printf("%d",a-b);}
}

int min(a,b,c){
    return ret;
}

Compiler output:
main.c: In function 'min':
main.c:12:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
   12 | int min(a,b,c){
      |     ^~~
main.c:12:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:12:5: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:13:12: error: 'ret' undeclared (first use in this function)
   13 |     return ret;
      |            ^~~
main.c:13:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
  int n, k;
  cin >> n >> k;
  cout < n - k << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |   cout < n - k << endl;
      |          ~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = (int)1e9 + 7;
const int INF = (int)100100100;

int main() {
    //ll N; cin >> N;
    ll N,M; cin >> N >> M;
    //string S; cin >> S;
    //ll H,W; cin >> H >> W;
    if(M==1)cout << 0;
  	else cout << N-K;
    


}

/*



 */


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'K' was not declared in this scope
   13 |         else cout << N-K;
      |                        ^
Language: C++

#include<bits/stdc++.h>
int main()
{
  int n,k;
  cin>>n>>k;
  int res=n%k;
  cout<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n>>k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout<<res;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

public class Solution {
    private static Scanner input = new Scanner(System.in);

    public static void main(String[] args) {
        int balls = input.nextInt();
        int people = input.nextInt();

        if (people == 1) {
            System.out.println(0);
        } else {
            System.out.println(balls - people);
        }
    }
}


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

import java.util.*;
import java.io.*;
public class Solution {
    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = in.nextInt();  // Scanner has functions to read ints, longs, strings, chars, etc.
        int k = in.nextInt();
        int answer = n-k;
        if (k==1)
        {
            answer = 0;
        }
        System.out.println(answer);
    }
}

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

#include "iostream"
using namespace std;
int main{
  int a,b;
  cin>>a>>b;
  int ans;
  if(b==1)ans=0;
  else ans=a-b;
  cout<<ans<<endl;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int a,b;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin>>a>>b;
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'if'
    7 |   if(b==1)ans=0;
      |   ^~
a.cc:8:3: error: expected unqualified-id before 'else'
    8 |   else ans=a-b;
      |   ^~~~
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++

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

int main(){
	
  	int n, k;
  	cin  >> n >> k;
  	n /= k;
  	n--;
  	cout << n << '\n';
	return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin  >> n >> k;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <bits/stdc++.h>
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << n << '\n';
      |         ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'N'
    6 |   cin N >> K;
      |      ^~
      |      ;
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// ボールの数
		int N = sc.nextInt();
		// 人数
		int K = sc.nextInt();

		int rem = N - k;
      System.out.println(rem);
      
	}
}

Compiler output:
Main.java:10: error: cannot find symbol
		int rem = N - k;
		              ^
  symbol:   variable k
  location: class Main
1 error
Language: C++

using System;

namespace diverta_2019_Programming_Contest_2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int k = int.Parse(input[0]);
            int n = int.Parse(input[1]);

            if (n == 1)
                Console.WriteLine(0);
            else
            {
                int max = k - n + 1;
                Console.WriteLine(max - 1);
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:21:6: error: expected ';' after class definition
   21 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void diverta_2019_Programming_Contest_2::Program::Main(int*)':
a.cc:9:13: error: 'string' was not declared in this scope
    9 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:9:20: error: expected primary-expression before ']' token
    9 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:10:21: error: expected primary-expression before 'int'
   10 |             int k = int.Parse(input[0]);
      |                     ^~~
a.cc:11:21: error: expected primary-expression before 'int'
   11 |             int n = int.Parse(input[1]);
      |                     ^~~
a.cc:14:17: error: 'Console' was not declared in this scope
   14 |                 Console.WriteLine(0);
      |                 ^~~~~~~
a.cc:18:17: error: 'Console' was not declared in this scope
   18 |                 Console.WriteLine(max - 1);
      |                 ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{

	ll n,k;
  cin>>n>>k;
  if(k==1)cout<<0<<endl;
  else
  cout<<n-k<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'll' was not declared in this scope
    6 |         ll n,k;
      |         ^~
a.cc:7:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   cin>>n>>k;
      |        ^
      |        yn
a.cc:7:11: error: 'k' was not declared in this scope
    7 |   cin>>n>>k;
      |           ^
Language: C++

#include <iostream>
using namespace std;
int main() {
  long long n,k; cin>>n>>k;
  cout<<(n>1)?n-k:0LL<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    5 |   cout<<(n>1)?n-k:0LL<<endl;
      |                   ~~~^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main() {
  ll n,k; cin>>n>>k;
  cout<<(n>1)?n-k:0LL<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll n,k; cin>>n>>k;
      |   ^~
a.cc:4:16: error: 'n' was not declared in this scope
    4 |   ll n,k; cin>>n>>k;
      |                ^
a.cc:4:19: error: 'k' was not declared in this scope
    4 |   ll n,k; cin>>n>>k;
      |                   ^
a.cc:5:22: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    5 |   cout<<(n>1)?n-k:0LL<<endl;
      |                   ~~~^~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before ';' token
    6 |   cin >> N >> K >>;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k>>cin>>n>>k;
  if(k==1)cout<<0<<endl;
  else cout<<n-k<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: expected initializer before '>>' token
    4 |   int n,k>>cin>>n>>k;
      |          ^~
a.cc:5:6: error: 'k' was not declared in this scope
    5 |   if(k==1)cout<<0<<endl;
      |      ^
Language: C++

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

int main(void)
{
  int n,k;
  cim>>n>>k;
  if(n<k)
   cout<<1<<endl;
  else if(n==k)
    cout<<0<<endl;
  else
    cout<<n-k<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cim' was not declared in this scope
    7 |   cim>>n>>k;
      |   ^~~
Language: C

#include <stdio.h>
int main(void){
	int N,N1 K,A;
	A = N%K;
	printf("%d"&A);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'K'
    3 |         int N,N1 K,A;
      |                  ^
main.c:4:9: error: 'A' undeclared (first use in this function)
    4 |         A = N%K;
      |         ^
main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:15: error: 'K' undeclared (first use in this function)
    4 |         A = N%K;
      |               ^
Language: C

#include<stdio.h>
int main(){
  int N,K;
  scanf("%d %d",&N,&K);
  printf(N-K);
  
  return 0
}

Compiler output:
main.c: In function 'main':
main.c:5:11: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    5 |   printf(N-K);
      |          ~^~
      |           |
      |           int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:7:11: error: expected ';' before '}' token
    7 |   return 0
      |           ^
      |           ;
    8 | }
      | ~
Language: C++

#include<bits/stdc++.h>
int n,k;
int main()
{
	cin>>n>>k;
	if(k==1)cout<<'0';
	else cout<<n-k;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin>>n>>k;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |         if(k==1)cout<<'0';
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         else cout<<n-k;
      |              ^~~~
      |              std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
      
      	if(k == 1){
        		System.out.println(0);
      		}elseif(n < K){
        		System.out.println(1);
   		}else{
        System.out.println(n-k);
      }
      }
}

Compiler output:
Main.java:11: error: ';' expected
      		}elseif(n < K){
      		              ^
Main.java:13: error: 'else' without 'if'
   		}else{
   		 ^
2 errors
Language: C++

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

main(){
	cin >> n >> k;
	if(k==1)
		cout << 0;
	else
		cout << n - k;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:5:21: error: 'k' was not declared in this scope
    5 |         cin >> n >> k;
      |                     ^
Language: C++

#include<bits/stdc++.h>
int main(){
  int n,k;
  cin>>n>>k;
  cout<<n%k;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin>>n>>k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout<<n%k;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define f(i, a, b) for(ll i = a; i <= b; ++i)
#define ff(i, a, b) for(ll i = a; i < b; ++i)
#define F(i, a, b) for(ll i = a; i >= b; --i)
#define FF(i, a, b) for(ll i = a; i > b; --i)
#define x first
#define y second
#define X real()
#define Y imag()
using namespace std;
typedef complex<ll> P;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;



signed main(){
	scanf("%d %d", &n, &k);
	if(k == 1) printf("0");
	else{
		printf("%d", n-k);
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'n' was not declared in this scope; did you mean 'yn'?
   19 |         scanf("%d %d", &n, &k);
      |                         ^
      |                         yn
a.cc:19:29: error: 'k' was not declared in this scope
   19 |         scanf("%d %d", &n, &k);
      |                             ^
Language: Java

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

class Main{
  public static void main(String[] *args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int k=sc.nextInt();
    System.out.format("%d", n%k);
  }
}

Compiler output:
Main.java:5: error: <identifier> expected
  public static void main(String[] *args){
                                  ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  	int a,b;
  	cin>>a>>b;
  	cout<<(k==1?0:a-b)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'k' was not declared in this scope
    6 |         cout<<(k==1?0:a-b)<<endl;
      |                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cstring> 
#include<cassert>
#include<cmath>
#include<sstream>
#include<fstream>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
void solve(int ga,int sa,int ba,int sb,int sb,int bb,int &ma){
	for(int g=0;g<=5000;g++){
		for(int s=0;s<=5000;s++){
			if(n-g*ga-s*sa>=0){
				int re=n-g*ga-s*sa,b=0;
				if(ba<bb){
					b=re/ba;
					re-=b*ba;
				}
				int now=re+g*gb+s*sb+b*bb;
				ma=max(now,ma);
			}
			if(n-g*gb-s*sb>=0){
				int re=n-g*gb-s*sb,b=0;
				if(bb<ba){
					b=re/bb;
					re-=b*bb;
				}
				int now=re+g*ga+s*sa+b*ba;
				ma=max(now,ma);
			}
		}
	}
}
int main(){
	int n,ga,sa,ba,gb,sb,bb;
	cin>>n>>ga>>sa>>ba>>gb>>sb>>bb;
	int ma=n;
	solve(ga,sa,ba,gb,sb,bb,ma);
	solve(ga,ba,sa,gb,bb,sb,ma);
	solve(sa,ga,ba,sb,gb,bb,ma);
	solve(sa,ba,ga,sb,bb,gb,ma);
	solve(ba,ga,sa,bb,gb,sb,ma);
	solve(ba,sa,ga,bb,sb,gb,ma);
	cout<<ma;
}

Compiler output:
a.cc:17:44: error: redefinition of 'int sb'
   17 | void solve(int ga,int sa,int ba,int sb,int sb,int bb,int &ma){
      |                                        ~~~~^~
a.cc:17:37: note: 'int sb' previously declared here
   17 | void solve(int ga,int sa,int ba,int sb,int sb,int bb,int &ma){
      |                                 ~~~~^~
a.cc: In function 'void solve(...)':
a.cc:20:28: error: 'n' was not declared in this scope
   20 |                         if(n-g*ga-s*sa>=0){
      |                            ^
a.cc:23:41: error: 'b' was not declared in this scope
   23 |                                         b=re/ba;
      |                                         ^
a.cc:26:46: error: 'gb' was not declared in this scope; did you mean 'g'?
   26 |                                 int now=re+g*gb+s*sb+b*bb;
      |                                              ^~
      |                                              g
a.cc:26:54: error: 'b' was not declared in this scope
   26 |                                 int now=re+g*gb+s*sb+b*bb;
      |                                                      ^
a.cc:29:28: error: 'n' was not declared in this scope
   29 |                         if(n-g*gb-s*sb>=0){
      |                            ^
a.cc:29:32: error: 'gb' was not declared in this scope; did you mean 'g'?
   29 |                         if(n-g*gb-s*sb>=0){
      |                                ^~
      |                                g
a.cc:32:41: error: 'b' was not declared in this scope
   32 |                                         b=re/bb;
      |                                         ^
a.cc:35:54: error: 'b' was not declared in this scope
   35 |                                 int now=re+g*ga+s*sa+b*ba;
      |                                                      ^
Language: C++

#include <iostream>
#include<bits/stdc++.h>
 
int main()
{
	int N,temp,i,j;
	int A[100000];
	int B[100000];
	int C[100000];
	int ans,stop;
 
 
	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%d", &A[i]);
 
	}
 
 
	sort(A,A+N);
 
		B[0] = A[0];
		C[0] = A[N-1];
		ans = A[0] - A[N - 1];
		stop = 1;
 
	for (i = N-2 ; i > 1; i--) {
 
		if (A[i - 1] < 0) {
			stop = i;
			break;
		}
		B[N-i-1] = ans;
		C[N-i-1] = A[i];
		ans = ans - A[i];
	}
	
  	B[N-stop-1] = A[i];
	C[N-stop-1] = ans;
	ans = A[i] - ans;
  	
  
	for(i=stop-1; i > 0; i--){
		B[N - i - 1] = ans;
		C[N - i - 1] = A[i];
		ans = ans - A[i];
 
	}
 
	printf("%d\n", ans);
		for (i = 0; i < N-1; i++) {
			printf("%d %d\n",B[i], C[i]);
	}
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   20 |         sort(A,A+N);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: Java

package hello;

import java.util.*;

public class main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int cnt=0;
        if(K>1) {          	
         cnt = N-K;	
        }
        System.out.println(cnt);
    }
}


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

import java.util.*;

public class main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int cnt=0;
        if(K>1) {          	
         cnt = N-K;	
        }
        System.out.println(cnt);
    }
}

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

#include <iostream>
using namespace std;
int n,k;
int main(){
  cin>>n>>k;
  cout<<(k==1?0:n-k)<<endl;
  ｝

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: '\U0000ff5d' was not declared in this scope
    7 |   ｝
      |   ^~
a.cc:7:5: error: expected '}' at end of input
    7 |   ｝
      |     ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
  int n,k;
  cin >> n >> k;
  if (k==1) cout << 0 <, endl;
  else cout << n-k << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected primary-expression before ',' token
    6 |   if (k==1) cout << 0 <, endl;
      |                        ^
Language: C++

#include <bits/stdc++.h>
int main(void){
  int n,k;
  cin >> n >> k;
  if (k==1) cout << 0 <, endl;
  else cout << n-k << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> n >> k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   if (k==1) cout << 0 <, endl;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:5:24: error: expected primary-expression before ',' token
    5 |   if (k==1) cout << 0 <, endl;
      |                        ^
a.cc:5:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    5 |   if (k==1) cout << 0 <, endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:6:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   else cout << n-k << endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   else cout << n-k << endl;
      |                       ^~~~
      |                       std::endl
/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 rep(i, n) for(ll i = 0; i < n; ++i)
#define repR(i, n) for(ll i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(ll i = n; i >= 0; ++i)
#define FOR(i, m, n) for(ll i = m; i < n; ++i)
#define FORR(i, m, n) for(ll i = m;i >= n;--i)
#define VSORT(v) sort(v.begin(), v.end());
#define VREV(v) reverse(v.begin(), v.end());
#define INF 999999999
#define itn ll
#define ednl endl
using namespace std;
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vector<ll> A(N);
	vector<ll> B(N);
	
	FDS(i,N){
		cin>>A[i]>>B[i];
	}
	
	vector<pair<ll,ll>> sa;
	FDS(i,N)FDS(j,N){
		if(i==j)continue;
		sa.push_back(makepair(A[j]-A[i],B[j]-B[i]));
	}
	int ans=N;
	FDS(i,sa.size()){
		ll x=sa[i].first,y=sa[i].second;
		int c=0;
		FDS(k,sa.size()){
			if(sa[k].first==x&&sa[k].second==y){
				c++;
			}
		}
		ans=min(ans,N-c);
		
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:30: error: 'makepair' was not declared in this scope
   32 |                 sa.push_back(makepair(A[j]-A[i],B[j]-B[i]));
      |                              ^~~~~~~~
Language: C

#include<stdio.h>
int main()
{
  int n,k;
  scanf("%d",&n);
  scanf("%d",&k);
  print("%d\n",n-k);
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    7 |   print("%d\n",n-k);
      |   ^~~~~
      |   printf
Language: C++

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

ll main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    return 0;
}

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

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    return 0;
}

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

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
}

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

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
}

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

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
}

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

///                ..:: In The Name Of God ::..
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(int){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc:34:5: warning: first argument of 'int main(long long int)' should be 'int' [-Wmain]
   34 | int main(int){
      |     ^~~~
a.cc:34:5: warning: 'int main(long long int)' takes only zero or two arguments [-Wmain]
Language: C++

#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
}

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

#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define endl '\n'
#define int long long
#define ll long long
#define vi vector<int>
#define vii vector<pii>

using namespace std;

int main(){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    if(K == 1){
        cout << 0 << endl;
    }
    else{
        cout << N-K << endl;
    }
    
return 0;
}

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

#include<vector>
#include<map>
#include <string>
using namespace std;

int main(){
    int ans=0;
    int N;
    
    cin>>N;
    vector<pair<int,int>> xy(N);

    

    for(int i=0;i<N;i++){
        int a=0,b=0;
        cin>>a>>b;
        xy[i]=make_pair(a,b);
    }

    ans=50;

    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            int p=xy[i].first-xy[j].first;
            int q=xy[i].second-xy[j].second;
            int count=0;

            for(int k=0;k<N;k++){
                for(int l=0;l<N;l++){
                    if(l==k){
                        continue;
                    }
                    if(xy[k].first-xy[l].first==p && xy[k].second-xy[l].second==q){
                        count++;
                    }
                }
            }
            ans=min(N-count,ans);
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin>>N;
      |     ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:43:5: error: 'cout' was not declared in this scope
   43 |     cout<<ans<<endl;
      |     ^~~~
a.cc:43:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:16: error: 'endl' was not declared in this scope
   43 |     cout<<ans<<endl;
      |                ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <string>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected '(' before '{' token
   11 |   }else if{
      |           ^
      |           (
a.cc:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java



import java.util.Scanner;

public class balls {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		if(k==1) {
			System.out.println("0");
		}
		else {
			System.out.println(n-(k-1)-1);
			
		}

	}

}


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

# include "cstdio"
# include "iostream"
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  ans=n-k;
  if(n==1)
    ans=0;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ans=n-k;
      |   ^~~
      |   abs
Language: C++

# include "cstdio"
# include "iostream"
uaing namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  ans=n-k;
  if(n==1)
    ans=0;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:3:1: error: 'uaing' does not name a type
    3 | uaing namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n>>k;
      |   ^~~
      |   std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ans=n-k;
      |   ^~~
      |   abs
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  int n,k;
  cin>>n>>k;
  if(k==1)cout<<0<<endl;
  else cout<<n-k+1<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: expected '}' at end of input
    8 |   else cout<<n-k+1<<endl;
      |                          ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
uing namespace std;
main(){
  int a,b;
  cin>>a>>b;
  if(b==1)cout<<0<<endl;
  else{
    int c=a-b;
    cout<<c<<endl;
  }
}


Compiler output:
a.cc:2:1: error: 'uing' does not name a type; did you mean 'uint'?
    2 | uing namespace std;
      | ^~~~
      | uint
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a>>b;
      |   ^~~
      |   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
      |                  ^~~
a.cc:6:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(b==1)cout<<0<<endl;
      |           ^~~~
      |           std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(b==1)cout<<0<<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)
      |     ^~~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout<<c<<endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:9:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |     cout<<c<<endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~