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

#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>
typedef long long ll;
using namespace std;

int main(){
    int N;
    cin>>N;
    int a;
    a = N%1000;
    ans = (a+1)*1000-N;
    cout<<ans<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     ans = (a+1)*1000-N;
      |     ^~~
      |     abs
Language: C++

#include<iostream.h>
using namespace std;
int main(){
    int inp;
    cin>>inp;
    if(inp%1000==0) cout<<"0";
    else cout<<1000-(inp%1000);
    return 0;
}

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

#include <stdio.h>
int main(void){
  int N;
  scanf("%d",&N);
  if(N % 1000 != 0){
    printf("%d",1000 - N % 1000);
  }
  else{
    printf("0");
  }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:11:3: error: expected declaration or statement at end of input
   11 |   return 0;
      |   ^~~~~~
Language: Java


import java.util.Scanner;

public class Payment {

    public int findChange(int amount) {
        int n = 0;
        while (n < amount) {
            n = n + 1000;
        }
        return n - amount;
    }

    public static void main(String args[]) {
        Payment p = new Payment();
        Scanner sc = new Scanner(System.in);
        int amount = sc.nextInt();
        System.out.println(p.findChange(amount));
    }
}

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

#include <stack>
#include <math.h>
#include <vector>
#include <string>
#include <algorithm>
#include <map>

#define rep(i,n) for(int i=0; i < n; i++)
using ll =  long long;
using namespace std;
#define pi 3.14159265358979


int main()
{
    int n;
    cin >> n;
    int i = n;
    while (i % 1000 != 0)
    {
        i++;
    }
    
    cout << i - n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin >> n;
      |     ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <map>
  +++ |+#include <iostream>
    7 | 
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout << i - n << endl;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:22: error: 'endl' was not declared in this scope
   24 |     cout << i - n << endl;
      |                      ^~~~
a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    6 | #include <map>
  +++ |+#include <ostream>
    7 |
Language: C++

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

}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=3e5+9;


int main()
{
/*#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);*/
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin>>n;
    if(n%1000==0)cout<<0;
    else {
        int ned=n/1000;
        if(n%1000!=0)ned++;
        cout<<(1000*ned)-n<<endl; 

    }




    return 0;
}


Compiler output:
a.cc:12:2: error: #endif without #if
   12 | #endif
      |  ^~~~~
Language: C++

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

using namespace std;
int X,N;
int A[2000010]{};
bool B[2000010]{};
vector <int> C;
int main()
{
  cin>>N;
  if(N%1000=0)cout<<0;
  else cout<<1000-(N%1000);
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: lvalue required as left operand of assignment
   12 |   if(N%1000=0)cout<<0;
      |      ~^~~~~
Language: C++

#includew<iostream>
using namespace std ;
#define ll long long int
int main()
{

ll n ; cin>> n ;
  ll charge = ( n + 999)/1000 ; 
  
  cout<< charge*1000 - n <<endl ; 


}


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

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


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

#include<bits/stdc++.h>
#define test int t; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

typedef long long ll;
using namespace std;

int main()
{

       fast


           ll n;
           cin>>n;
           if(n<1000)
            cout<<1000-n<<endl;;
           else{
           ll temp=n/1000;
           cout<<min(n-(temp*1000),(temp+1)*1000-n)<<endl;
           }







return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'else' without a previous 'if'
   18 |            else{
      |            ^~~~
Language: C++

#include<iostream>

int main()
{
  int n;
  cin>>n;
  n=n%1000;
  n=1000-n;
  cout<<n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout<<n<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout<<n<<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 <stdio.h>
int main(void){
  int N;
  scanf("%d",&N);
  if(N % 1000 != 0){
    printf("%d",1000 - N % 1000);
  }
  else{
    printf('0');
  }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:9:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    9 |     printf('0');
      |            ^~~
      |            |
      |            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:11:3: error: expected declaration or statement at end of input
   11 |   return 0;
      |   ^~~~~~
Language: Java

import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;

public class TaskA {
	public static void main(String[] args) throws IOException{
		Scanner scanner = new Scanner(System.in);
		BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out));
			int money = scanner.nextInt() % 1000;
			int result = 0;
			if(money != 0)
				result = 1000 - money;
			log.write("" + result);
		log.flush();
	}
}


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

#include<iostream>
int main()
{
 	int n,ans;
  cin>>n;
  ans=n%1000;
  cout<<ans;
  return 0;
}

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;
      |   ^~~
      |   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:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout<<ans;
      |   ^~~~
      |   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>
using namespace std;

int main(void)
{
  int i,j;
  cin >> i;
if(1 <=n && n<=10000){
  j = i%1000;
  cout << j << endl;
  }
  else{ return 1;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'n' was not declared in this scope
    8 | if(1 <=n && n<=10000){
      |        ^
Language: C

#include <stdio.h>
int main(){
  int N,i;
  scanf("%d",&N);
  for(i=1;1;i++){
    if(N<=i*1000){
      break;}
  }
  printf("%d",&(i*1000-N));
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: lvalue required as unary '&' operand
    9 |   printf("%d",&(i*1000-N));
      |               ^
Language: C++

#include<iostream>
using namespace std;
 
int main(){
  int n;
  cin >> n;
  cout << (n%1000 == 0) ? 0 : 1000 - n % 1000 << endl;
}

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

int main()
{
  int price;
  int paid = 0;
  cin >> price;
  while(paid < price) {
    paid += 1000;
  }
  cout << (paid - price) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> price;
      |   ^~~
a.cc:9:3: error: 'cout' was not declared in this scope
    9 |   cout << (paid - price) << endl;
      |   ^~~~
a.cc:9:29: error: 'endl' was not declared in this scope
    9 |   cout << (paid - price) << endl;
      |                             ^~~~
Language: C++

#include<iostream>
int main()
{
  int n;cin>>n;
  if(n%1000==0)cout<<0;
  else
  {
    cout<<1000-(n%1000);
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   int n;cin>>n;
      |         ^~~
      |         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:5:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   if(n%1000==0)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:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout<<1000-(n%1000);
      |     ^~~~
      |     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 rep(i,n) for (int i=0;i<n;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n;
  cin>>n;
  cout<<(1000-n%1000)%1000<<endl;
}

Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ##include <bits/stdc++.h>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:5:11: error: 'pair' does not name a type
    5 | using P = pair<int,int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin>>n;
      |   ^~~
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout<<(1000-n%1000)%1000<<endl;
      |   ^~~~
a.cc:10:29: error: 'endl' was not declared in this scope
   10 |   cout<<(1000-n%1000)%1000<<endl;
      |                             ^~~~
Language: C

#include<stdio.h>

int main(void){
  int x,y=0;
  scanf("%d",&x);
  for(int i=0;y>x;i++){
    y+=1000;
  }
  printf("%d"y-x);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:14: error: expected ')' before 'y'
    9 |   printf("%d"y-x);
      |         ~    ^
      |              )
Language: C++

 #include <iostream>
using namespace std;

int main(){
    int n,re=0;
    cin>>n;

    while(1){
        int i==1;
        if(1000*i-n>=0){
            re=1000*i-n;
            break;
        }
        i++;
    }

    cout<<re<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected initializer before '==' token
    9 |         int i==1;
      |              ^~
a.cc:10:17: error: 'i' was not declared in this scope
   10 |         if(1000*i-n>=0){
      |                 ^
a.cc:14:9: error: 'i' was not declared in this scope
   14 |         i++;
      |         ^
Language: C

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	n%=1000;
	n=(1000-n)%1000;
	cout<<n;
	return 0;
}

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

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

int main(void)
{
  int i,j;
  cin >> i;
if(1 <=n; && n<=10000){
  j = i%1000;
  cout << j << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'n' was not declared in this scope
    8 | if(1 <=n; && n<=10000){
      |        ^
a.cc:8:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 | if(1 <=n; && n<=10000){
      |           ~~~~^~~~~~~
a.cc:8:14: error: label 'n' used but not defined
    8 | if(1 <=n; && n<=10000){
      |              ^
Language: C++

#include<iostream>
int main()
{
  int n;
  std::cin>>n;
  n<=1000? std::cout<<1000-n<<endl : std::cout<<0<<endl;
  return 0;
}

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

#include<iostream>
#include<bits/stdc++.h>
int main()
{
  int n;
  cin>>n;
  n=n/1000;
  n=n-1000;
  cout<<n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout<<n<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout<<n<<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 <stdio.h>
int main(){
  int N,i;
  scanf("%d",&N);
  for(i=1;1;i++){
    if(N<=i*1000){
      break;}
  }
  printf("%d",&i*1000-N);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: invalid operands to binary * (have 'int *' and 'int')
    9 |   printf("%d",&i*1000-N);
      |               ~~^
      |               |
      |               int *
Language: Java

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

// import java.text.DecimalFormat; 
// import java.text.DecimalFormatSymbols; 
 
 
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
 
public class TestClass {
    
    public static void main(String args[] ) throws Exception {
        /* Sample code to perform I/O:
         * Use either of these methods for input
 
        //BufferedReader
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String name = br.readLine();                // Reading input from STDIN
        System.out.println("Hi, " + name + ".");    // Writing output to STDOUT
 
        //Scanner
        Scanner s = new Scanner(System.in);
        String name = s.nextLine();                 // Reading input from STDIN
        System.out.println("Hi, " + name + ".");    // Writing output to STDOUT
        
        for Round off
         DecimalFormat deciFormat = new DecimalFormat(); 
        deciFormat.setMaximumFractionDigits(9); 
        */
 
        // Write your code here
        StringBuffer str = new StringBuffer();
        PrintWriter pw=new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        int T =Integer.parseInt(br.readLine());
        int ans=0;
        if(T%1000!=0)
            ans = 1000- T%1000;
        str.append(ans);
        pw.print(str.toString());
        pw.close();
    }
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
    
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin N;
  cout << N % 1000 << endl;
}

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

#include<iostream.h>
using namespace std;
int main()
{
   long int n;
  cin>>n;
  if(n%1000==0)
    cout<<0<<endl;
  else
  {
    long rem=n%1000;
    cout<<1000-rem<<endl;
  }
}

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

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

int main() {
	 ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    
    ll n;
    cin>>n;
    ll x=1000-(n%1000);
    if(x==1000)
    {
        x=0;
    }
    cout<<x<<endl;
    
	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int n,nn;
  cin >> n;
  nn=1000-n%1000 <<endl;
  if(nn==1000)nn=0;
  cout << nn <<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |   nn=1000-n%1000 <<endl;
      |      ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>

typedef long long ll;

int hoge4(){
  ll N;
  std::cin >> N;
  ll temp = N % 1000;
  if(temp == 0){
    std::cout << 0 << std::endl;
    return 0;
  }
  std::cout << 1000 - temp << std::endl;
  return 0;
}


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
#define mp make_pair
#define pb push_back
#define f first
#define s second


//var 


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

	cin >> n;
  	if(n%1000 == 0){
      	cout << 0 << endl;
    }else{
		cout << 1000 - n%1000 << endl;
    }

    cout.flush();
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   18 |         cin >> n;
      |                ^
      |                yn
Language: C++

#include <iostream>
using namespace std;

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

    while(1){
        int i==1;
        if(1000*i-n>=0){
            int re=1000*i-n;
            break;
        }
    }

    cout<<re<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected initializer before '==' token
    9 |         int i==1;
      |              ^~
a.cc:10:17: error: 'i' was not declared in this scope
   10 |         if(1000*i-n>=0){
      |                 ^
a.cc:16:11: error: 're' was not declared in this scope
   16 |     cout<<re<<endl;
      |           ^~
Language: C++

/*
  Vivek Rathi
  CSE 3rd Year
  MNNIT
  THUMB RULE - THINK FOR DP FIRST AND THEN GREEDY!!!
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define sz(x)	(ll)x.size()
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define inf 1e18
#define flush fflush(stdout);
#define endl '\n'
//unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
//shuffle (foo.begin(), foo.end(), std::default_random_engine(seed));
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}
//-------------------------------Template--Above-----------------------------------------------

int main()
{
	boost
	ll n;
      	cin>>n;
      	ll mod=n%1000;
      	cout<<(1000-mod)%1000<<endl;1
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:38: error: expected ';' before 'return'
   54 |         cout<<(1000-mod)%1000<<endl;1
      |                                      ^
      |                                      ;
   55 |         return 0;
      |         ~~~~~~
Language: C++

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

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

  int result = n % 1000;
  if (result == 0) {
    cout << result << "\n";
  } else {
    cout << 1000 - result << "\n"
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:34: error: expected ';' before '}' token
   12 |     cout << 1000 - result << "\n"
      |                                  ^
      |                                  ;
   13 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi acos(-1)
#define pb push_back
using namespace std;
int main()
{
    ll i,j,k,a,b,c,n,t,m,p,q,d,e,f,x,y,g,z,h;
    ld aa,bb,cc,dd,ee,ff,kk,gg;
    vector<ll > v,s,vv;
    vector<string> vs;
    map<ll,ll> sa,ta,ma;
    priority_queue<char,vector<ll>,greater<ll> > aq,tq,pq;
    string st,et,ft,pt,ct;
    deque<ll> de;
    ios_base::sync_with_stdio(false);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    cin>>n;
    a = n%1000;
    if(a>500)cout<<1000-a<<endl;
    else cout<<a<<endl;
}


Compiler output:
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<char, std::vector<long long int>, std::greater<long long int> >':
a.cc:14:50:   required from here
   14 |     priority_queue<char,vector<ll>,greater<ll> > aq,tq,pq;
      |                                                  ^~
/usr/include/c++/14/bits/stl_queue.h:520:67: error: static assertion failed: value_type must be the same as the underlying container
  520 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/14/bits/stl_queue.h:520:67: note: 'std::integral_constant<bool, false>::value' evaluates to false
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
int main()
// {
// #ifndef ONLINE_JUDGE
//    	freopen("input.txt","r",stdin);
//     freopen("output.txt","w",stdout);
// #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    // cin >> t;
    t  = 1;
    while(t--)
    {
    	ll n;
   		cin>>n;
   		n=n%1000;
   		cout<<1000-n;

    }
    return 0;
}

Compiler output:
a.cc:14:5: error: expected initializer before 'ios_base'
   14 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:15:5: error: 'cin' does not name a type
   15 |     cin.tie(NULL);
      |     ^~~
a.cc:18:5: error: 't' does not name a type; did you mean 'tm'?
   18 |     t  = 1;
      |     ^
      |     tm
a.cc:19:5: error: expected unqualified-id before 'while'
   19 |     while(t--)
      |     ^~~~~
a.cc:27:5: error: expected unqualified-id before 'return'
   27 |     return 0;
      |     ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) v.begin(),v.end()

int main() {
  int n,nn;
  cin >> n;
  nn=1000-n%1000 <<endl;
  if(nn=1000)nn=0;
  cout << nn <<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |   nn=1000-n%1000 <<endl;
      |      ~~~~~~~~~~~~^~~~~~
Language: Java

import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.println(n % 1000 ? 0 : 1000 - (n % 1000));
  }
}


Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to boolean
    System.out.println(n % 1000 ? 0 : 1000 - (n % 1000));
                         ^
1 error
Language: C

#include <bits/stdc++.h>
 
#define fi first
#define se second
#define pb push_back
 
#define limit (int) (1005)
#define mod (int) 1000000007

using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
using ld = long double;


int main()
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    
    int n;
    cin >> n;

    if (n%1000 == 0)
    {
        cout << 0;
    } else {
        cout << 1000 - n%1000;
    }

    
    return 0;
}
















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

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

int main() {
    cin >> n;
    cout<<1000-n%1000
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before '}' token
    7 |     cout<<1000-n%1000
      |                      ^
      |                      ;
    8 | }
      | ~
Language: C++

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

int main() {
  int N;
  cin >> N;
  cout << (1000-N)%1000) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: expected ';' before ')' token
    7 |   cout << (1000-N)%1000) << endl;
      |                        ^
      |                        ;
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long ll;

/////////////////////////////////DEBUG/////////////////////////////////
void printd(const char* format)
{
  #ifdef DEBUG
    std::cout << format;
  #endif
}
template<typename T, typename... Targs>
void printd(const char* format, T value, Targs... Fargs)
{
  #ifdef DEBUG
    for ( ; *format != '\0'; format++ ) {
        if ( *format == '%' ) {
           std::cout << value;
           printd(format+1, Fargs...);
           return;
        }
        std::cout << *format;

    }
  #endif
}

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef DEBUG
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

///////////////////////////////// YAY /////////////////////////////////
void solve()
{
  int n; cin>>n;
  cout<<((n/1000)+1)*1000 -n)<<endl;
}

int main(int argc, char const *argv[]) {
  int t;
  t=1;

  #ifdef DEBUG
    freopen("input.txt","r", stdin);
    clock_t start, end;
    start = clock();
    cin>>t;
  #endif


  for(int i = 1; i<=t; i++)
  {
    // std::cout << "Case "<<i<<": " << '\n';
    solve();
  }

  #ifdef DEBUG
    end = clock();
    double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    time_taken *= 1000;
    cout << "Time taken by program is : " << fixed << time_taken << setprecision(5);
    cout << " ms " << endl;
  #endif
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:81:29: error: expected ';' before ')' token
   81 |   cout<<((n/1000)+1)*1000 -n)<<endl;
      |                             ^
      |                             ;
Language: C++

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

int main(){
    cin>>n;
    cout<<(1000-n%1000)%1000<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin>>n;
      |          ^
      |          yn
Language: C++

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
 

int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	
	int T;
	cin >> T;
	int rest = T%1000
	cout << (1000-rest)%1000 << "\n";


	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected ',' or ';' before 'cout'
   16 |         cout << (1000-rest)%1000 << "\n";
      |         ^~~~
Language: C++

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

int main(){
	int n;
	cin >> n;
  if (n%1000==0) {
    cout << 0 << endl;
  } else if {
	cout << 1000 - n%1000 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected '(' before '{' token
   11 |   } else if {
      |             ^
      |             (
Language: C++

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

int main()
{
 	int n;
    cin >> n;
  cout << 1000 - n%1000
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before '}' token
    8 |   cout << 1000 - n%1000
      |                        ^
      |                        ;
    9 | }
      | ~
Language: C

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

#define         pb         push_back
#define         sf(x)      scanf("%d",&x)
#define         sfl(x)     scanf("%lld",&x)
#define         pf(x)      printf("%d\n",x)
#define         pfl(x)     printf("%lld\n",x)
#define         endl       '\n'
#define         pii        pair<int,int>
#define         mapii      map<int,int>
#define         mapll      map<ll,ll>
#define         mapci      map<char,int>
#define         mapcl      map<char,ll>
#define         mapsi      map<string,int>
#define         mapsl      map<string,ll>
#define         pll        pair<ll,ll>
#define         vi         vector<int>
#define         vl         vector<ll>
#define         vd         vector<double,double>
#define         all(c)     c.begin(),c.end()
#define         F          first
#define         S          second
#define         mp         make_pair
#define        ftc(x)      cerr << #x << ": " << x << " " << endl;
#define         PI         acos(-1)
#define         lcm(a,b)   ((a*b)/__gcd(a,b))
#define        optimize    ios_base::sync_with_stdio(false);cin.tie(NULL);
#define        sqr(a)       ((a)*(a))


int main()
{
    int tst;
//
//    cin >> tst;
//
//    while(tst--)
//    {
//
//    }

int a,b,i,j,k,l,m,n;
//ll a,b,i,j,k,l,m,n;

cin >> n;
 m = (n+1000-1)/1000;
m = m*1000 - n;

//int ar[n+10];
//ll ar[n+10];
//for(i=0;i<n;i++)cin >>ar[i];

cout << m << endl;
}


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

#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define fo(i,a) for(ll i=0;i<a;i++)
#define Fo(i,a,n) for(ll i=a; i<n; i++)

using namespace std;

void solve(){
    ll n,k;
    cin>>n;
    cout<<max(0,n-n%1000);
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin >> t;
    while(t--)
        solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:15:14: error: no matching function for call to 'max(int, long long int)'
   15 |     cout<<max(0,n-n%1000);
      |           ~~~^~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:15:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   15 |     cout<<max(0,n-n%1000);
      |           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:15:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   15 |     cout<<max(0,n-n%1000);
      |           ~~~^~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long int
#define fo(i, n) for (ll i = 0; i < n; i++)
#define fo1(i, n) for (ll i = 1; i <= n; i++)
#define pi (double)3.14159265359
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define vect vector<ll>
#define pb push_back
#define mod (ll) pow(10, 9) + 7
#define prq priority_queue <int, vector<int>, greater<in1t>>
#define scan(x) scanf("%lld",&x);
#define print(x) printf("%lld\n",x);
using namespace std;

void solve(){
	ll n;
  	cin>>n;
  	if(n%1000==0)
      cout<<"0"<<endl;
  else{
    cout<<(1000-(n%1000))<<endl;
}
int main(){
	int t=1;
	while (t--){
		solve();
	}
	return 0;
}

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

import java.util.Scanner;

public Class Main{
  public static void main(String[] args){
 	Scanner scan = new.Scanner(System.in);
    
    int a = scan.nextInt();
    System.out.println(1000 - a % 1000);
    
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Class Main{
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args){
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: <identifier> expected
 	Scanner scan = new.Scanner(System.in);
 	                  ^
Main.java:11: error: class, interface, enum, or record expected
}
^
4 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define deb(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;

typedef long long int ll;
typedef string str;

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 
 
ll nCrModP(ll n, ll r, ll p) 
{ 
    if (!r) 
      return 1; 
  
	ll fac[n+1]; 
   	fac[0] = 1; 
    for (ll i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* power(fac[r], p-2,p) % p * power(fac[n-r], p-2,p) % p) % p; 
}

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

void fast(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll mex(ll * arr,ll n)
{
    ll i=0;
    while(i<n && h[i]!=0)
        i++;
    return i;
}

int main ()
{
	
	ll t,n,m,k,i,j;
	cin >> t;
    if(t%1000==0)
        n=0;
    else
        n=1000-t%1000;
	cout << n << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'll mex(ll*, ll)':
a.cc:53:18: error: 'h' was not declared in this scope
   53 |     while(i<n && h[i]!=0)
      |                  ^
Language: C++

#include <iostream.
using namespace std;
int main() {
    int N;
    cin >> N;
    cout << N % 1000 << endl;
}

Compiler output:
a.cc:1:20: error: missing terminating > character
    1 | #include <iostream.
      |                    ^
a.cc:1:10: fatal error: iostream.: No such file or directory
    1 | #include <iostream.
      |          ^
compilation terminated.
Language: C++

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

int main()
{
  int n;
  cin >> n;
  
  if(n%1000==0)
    cout << (n/1000) << endl;
  
  else 
  {
  	int x = n/1000;
    n -= x*1000;
    cout << n << endl;
  }
  return 0;
}

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

#include <cstdio>
using namespaces std;

int N;

int main() {
  scanf("%d", &N);
  printf("%d\n", (1000 - N % 1000) % 1000);
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaces'
    2 | using namespaces std;
      |       ^~~~~~~~~~
Language: C++

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


int main() {
  int N;
  cin >> N;
  
  int S = N/1000;
  int T = S*1000
  cout << N%T <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'cout'
   12 |   cout << N%T <<endl;
      |   ^~~~
Language: C++

v#include <bits/stdc++.h>
#define Int int64_t
#define pb push_back
using namespace std;
const int MAXN=500005;
vector<int> A(MAXN);
Int N,M,X,Y,B,K,Z,T;
int main()
{
   cin>>N;
   cout<<(1000-(N%1000))%1000<<"\n";
}

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:6:1: error: 'vector' does not name a type
    6 | vector<int> A(MAXN);
      | ^~~~~~
a.cc:2:13: error: 'int64_t' does not name a type
    2 | #define Int int64_t
      |             ^~~~~~~
a.cc:7:1: note: in expansion of macro 'Int'
    7 | Int N,M,X,Y,B,K,Z,T;
      | ^~~
a.cc:1:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | v#include <bits/stdc++.h>
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
   10 |    cin>>N;
      |    ^~~
a.cc:10:9: error: 'N' was not declared in this scope
   10 |    cin>>N;
      |         ^
a.cc:11:4: error: 'cout' was not declared in this scope
   11 |    cout<<(1000-(N%1000))%1000<<"\n";
      |    ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define deb(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;

typedef long long int ll;
typedef string str;

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 
 
ll nCrModP(ll n, ll r, ll p) 
{ 
    if (!r) 
      return 1; 
  
	ll fac[n+1]; 
   	fac[0] = 1; 
    for (ll i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* power(fac[r], p-2,p) % p * power(fac[n-r], p-2,p) % p) % p; 
}

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

void fast(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll mex(ll * arr,ll n)
{
    ll i=0;
    while(i<n && h[i]!=0)
        i++;
    return i;
}

int main ()
{
	
	ll t,n,m,k,i,j;
	cin >> t;
    if(t%1000==0)
        n=0;
    else
        n=1000-t%1000;
	cout << n << "\n"
	return 0;
}

Compiler output:
a.cc: In function 'll mex(ll*, ll)':
a.cc:53:18: error: 'h' was not declared in this scope
   53 |     while(i<n && h[i]!=0)
      |                  ^
a.cc: In function 'int main()':
a.cc:67:26: error: expected ';' before 'return'
   67 |         cout << n << "\n"
      |                          ^
      |                          ;
   68 |         return 0;
      |         ~~~~~~
Language: C++

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

int main() {
  int a;
  cin >> ;
  cout << a%1000 << endl;
}

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

#include <iostream>

int main(){
  int i = 0;
  std::cin >> i;
  std::cout << i % 1000;
  
  returm 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'returm' was not declared in this scope
    8 |   returm 0;
      |   ^~~~~~
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
    int n;cn>>n;
    if(n%1000==0)cout<<0<<endl;
    else cout<<1000-n%1000<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:11: error: 'cn' was not declared in this scope; did you mean 'n'?
   40 |     int n;cn>>n;
      |           ^~
      |           n