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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  string s;
  cin>>s;
  int num;
  int ans=1000;
  rep(i,s.size()-2){
    string str=s[i]+s[i+1]+s[i+2];
    num=stoi(str);
    ans=min(abs(753-num),ans);
  }
  cout<<ans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   24 |     string str=s[i]+s[i+1]+s[i+2];
a.cc:28:19: error: expected '}' at end of input
   28 |   cout<<ans<<endl;
      |                   ^
a.cc:18:17: note: to match this '{'
   18 | int main()      {
      |                 ^
Language: C++

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

int main()
{
  string s, t = "";
  cin >> s;
  int ans = 999;
  rep(i, s.size() - 2){
    t += s[i] + s[i + 1] + s[i + 2];
    ans = min(ans, abs(753 - atoi(t)));
    t = "";
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 |     ans = min(ans, abs(753 - atoi(t)));
      |                                   ^
      |                                   |
      |                                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main()
{
  string s, t;
  cin >> s;
  int ans = 999;
  rep(i, s.size() - 2){
    t = s[i] + s[i + 1] + s[i + 2];
    ans = min(ans, abs(753 - atoi(t)));
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 |     ans = min(ans, abs(753 - atoi(t)));
      |                                   ^
      |                                   |
      |                                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <queue>
using namespace std;

#define PI 3.14159265358979323846264338327950L

long long int res;

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

    string S;
    cin >> S;
    int N = S.size();
    int ans = 999;
    for (int i = 0; i <= N - 3; ++i)
    {
        int num = (c[i] - '0') * 100 + (c[i + 1] - '0') * 10 + c[i + 2] - '0';
        ans = min(ans, abs(num - 753));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: 'c' was not declared in this scope
   28 |         int num = (c[i] - '0') * 100 + (c[i + 1] - '0') * 10 + c[i + 2] - '0';
      |                    ^
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int min = 99999;
  int res = 0;
  for(int i = 0; i < S.length() - 2; i++) {
    int x = 100 * (S[i] - '0') + 10 * (S[i + 1] - '0') + (S[i + 2] - '0');
    if(abs(min - 753) > abs(x - 753)) {
      min = abs(min - 753);
      res = x;
    }
  }
  cout << x << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'x' was not declared in this scope
   18 |   cout << x << endl;
      |           ^
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;

int main() {
  string S;
  cin >> S;
  int min = 99999;
  for(int i = 0; i < S.length() - 2; i++) {
    int x = stoi(S[i] + S[i + 1] + S[i + 2]);
    min = abs(min - 765) > x ? x : min;
  }
  cout << min << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to 'stoi(int)'
   11 |     int x = stoi(S[i] + S[i + 1] + S[i + 2]);
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {
  string S;
  cin >> S;
  int min = 99999;
  for(int i = 0; i < S.length() - 2; i++) {
    int x = stoi(S[i] + S[i + 1] + S[i + 2]);
    min = abs(min - 765) > x ? x : min;
  }
  cout << min << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no matching function for call to 'stoi(int)'
   10 |     int x = stoi(S[i] + S[i + 1] + S[i + 2]);
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    int ans=1e9;
    int tmp;
    for(int i=0;i<<S.length()-2){
        tmp=(S[i]-'0')*100+(S[i+1]-'0')*10+(S[i+2]-'0');
        ans=min(ans,abs(tmp-753));
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:32: error: expected ';' before ')' token
    8 |     for(int i=0;i<<S.length()-2){
      |                                ^
      |                                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	string S;
	cin >> S;
    int ans = 753;
    string T;
	for(int i = 0; i < s.size()-2; i++) {
		T=s.substr(i,3);
		ans = min(mi,abs(753-((T[0]-'0')*100+(T[1]-'0')*10+(T[2]-'0'))));
	}
	cout<< ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 's' was not declared in this scope
    8 |         for(int i = 0; i < s.size()-2; i++) {
      |                            ^
a.cc:10:27: error: 'mi' was not declared in this scope; did you mean 'i'?
   10 |                 ans = min(mi,abs(753-((T[0]-'0')*100+(T[1]-'0')*10+(T[2]-'0'))));
      |                           ^~
      |                           i
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	string S;
	cin >> S;
    int ans = 753;
    string T;
	for(int i = 0; i < s.size()-2; i++) {
		T=s.substr(i,3);
		ans = min(mi,abs(753-((x[0]-'0')*100+(x[1]-'0')*10+(x[2]-'0'))));
	}
	cout<< ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: 's' was not declared in this scope
    8 |         for(int i = 0; i < s.size()-2; i++) {
      |                            ^
a.cc:10:27: error: 'mi' was not declared in this scope; did you mean 'i'?
   10 |                 ans = min(mi,abs(753-((x[0]-'0')*100+(x[1]-'0')*10+(x[2]-'0'))));
      |                           ^~
      |                           i
a.cc:10:40: error: 'x' was not declared in this scope
   10 |                 ans = min(mi,abs(753-((x[0]-'0')*100+(x[1]-'0')*10+(x[2]-'0'))));
      |                                        ^
Language: C++

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

int main(){
    string S;
    cin >> S;
    int ans = 753;
    for(int i = 2; i < S.size(); i++) {
        int x = stoi(S[i-2]+S[i-1]+S[i]);
        ans = min(ans,abs(ans-x));
    }
    cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: no matching function for call to 'stoi(int)'
    9 |         int x = stoi(S[i-2]+S[i-1]+S[i]);
      |                 ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int num;
  int res = 10000000
  for (int i = 0; i < (int)s.size() - 3; i++) {
    num = (s.at(i) - '0') * 100 + (s.at(i + 1) - '0') * 10 + (s.at(i + 2) - '0');
    res = min(res, abs(num - 753));
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for (int i = 0; i < (int)s.size() - 3; i++) {
      |   ^~~
a.cc:9:19: error: 'i' was not declared in this scope
    9 |   for (int i = 0; i < (int)s.size() - 3; i++) {
      |                   ^
Language: C++

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

int main() {
 string S; cin>>S;
  int A=0;
  int N[3]
  for(int i=0; i<S.size()-2; i++){
   N[0]=(int)(S.at(i)-'0');
    N[1]=(int)(S.at(i+1)-'0');
    N[2]=(int)(S.at(i+2)-'0');
    A=min(abs(A-753),abs(N-753));
  }
  cout<<A<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'for'
    9 |   for(int i=0; i<S.size()-2; i++){
      |   ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=0; i<S.size()-2; i++){
      |                ^
Language: C++

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

int main(){
  int num=1000;
  string s;
  cin>>s;
  
  for(int i=0;i<s.size()-2;i++){
    ans=s[i]*100+s[i+1]*10+s[i+2];
    num=min(num,abs(753-ans));
  }
  cout<<num<<endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     ans=s[i]*100+s[i+1]*10+s[i+2];
      |     ^~~
      |     abs
Language: C++

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

using namespace std;


int main() {
	long long int S, tmp = 0, min = 9999999999, D, number, result;;

	cin >> S;
	
	D = S;

	int count = 0;

	while (D != 0) {
		D /= 10;
		count += 1;
	}

	for (int i = count - 1 ; i > 1; i--) {
		tmp = 0;
		number = S / pow(10, i);
		number %= 10;
		tmp += number * 100;
		number = S / pow(10, i-1);
		number %= 10;
		tmp += number * 10;
		number = S / pow(10, i-2);
		number %= 10;
		tmp += number;

		result = abs(753 - tmp);
		if (min > result) min = result ;
	}


	cout << min;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: 'pow' was not declared in this scope
   24 |                 number = S / pow(10, i);
      |                              ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n,m=999;
  for(int i=0;i<strlen(s)-2;i++){
    n=abs((s[i]-'0')*100+(s[i+1]-'0')*10+s[i+2]-753);
    if(m>n)m=n;
  }
  cout << m;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    7 |   for(int i=0;i<strlen(s)-2;i++){
      |                        ^
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
using std::cout;
using std::cin;
using std::endl;

#include<string>
using std::string;

#include<cmath>
using std::abs;

#include<cstdlib>
using std::atoi;

int main()
{
  string s;
  cin >> s;
  
  const int favorite = 753;
  int min_diff = 1000;
  
  for (int i = 0; i < s.size(); i ++)
  {
    int tmp = atoi(s.substr(i, 3));
    if (abs(favorite - tmp < min_diff)) min_diff = tmp;
  }
        
  cout << min_diff << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   25 |     int tmp = atoi(s.substr(i, 3));
      |                    ~~~~~~~~^~~~~~
      |                            |
      |                            std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<iostream>
using std::cout;
using std::cin;
using std::endl;

#include<string>
using std::string;

#include<cmath>
using std::abs;

#include<cstdlib>
using std::atoi;

int main()
{
  string s;
  cin >> s;
  
  const int favorite = 753;
  int min_diff = 1000;
  
  for (int i = 0; i < s.size(); i ++)
  {
    int tmp = atoi(s.substr(i, 3));
    if (abs(favorite - tmp < min_diff) min_diff = tmp;
  }
        
  cout << min_diff << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:28: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   25 |     int tmp = atoi(s.substr(i, 3));
      |                    ~~~~~~~~^~~~~~
      |                            |
      |                            std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:26:39: error: expected ';' before 'min_diff'
   26 |     if (abs(favorite - tmp < min_diff) min_diff = tmp;
      |                                       ^~~~~~~~~
      |                                       ;
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:55: error: expected ')' before '}' token
   26 |     if (abs(favorite - tmp < min_diff) min_diff = tmp;
      |        ~                                              ^
      |                                                       )
   27 |   }
      |   ~                                                    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

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

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;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll n, d, x;
  cin >> n >> d >> x;
  rep(i, n) {
    ll a;
    cin >> a;
    x += d/a + 1;
  }
  cout << x << endl;
}

int main() {
  string s;
  cin >> s;
  ll res = INF;
  for (ll i = 0; i <= s.size()-3; i++) {
    for (ll j = i+1; j <= s.size()-2; j++) {
      for (ll k = j+1; k <= s.size()-1; k++) {
        ll tmp = 100*ctoi(s.at(i)) + 10*ctoi(s.at(j)) + ctoi(s.at(k));
        chmin(res, abs(753-tmp));
      }
    }
  }
  cout << res << endl;
}

Compiler output:
a.cc:66:5: error: redefinition of 'int main()'
   66 | int main() {
      |     ^~~~
a.cc:55:5: note: 'int main()' previously defined here
   55 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> input(int N) {
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  return vec;
}

int main() {
  string s;
  int a=1000;
  cin >> s;
  for(int i=0;i<s.size()-3;i++){
    string t=substr(i,3);
    int n=abs(stoi(t)-753);
    a=min(a,n);
  }
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   17 |     string t=substr(i,3);
      |              ^~~~~~
      |              strstr
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>

using namespace std;

int main(int argc, const char *argv[]) {
  int ans = 999;
  int tmp;
  char S[12];
  char a[2], b[2], c[2];
  scanf("%s", S);
  for (int i = 0; i < strlen(S) - 2; i++) {
    a[0] = S[i];
    b[0] = S[i+1];
    c[0] = S[i+2];
    tmp = abs(753 - (atoi(a) * 100 + atoi(b) * 10 + atoi(c)));
    ans = min(ans, tmp);
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:23: error: 'strlen' was not declared in this scope
   14 |   for (int i = 0; i < strlen(S) - 2; i++) {
      |                       ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <cstdlib>
  +++ |+#include <cstring>
    5 |
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
  int a=999;
  for(int i=0;i<N-3;i++){
  int b= (int)A[i]*100+(int)A[i+1]*10+(int)A[i];
    a=min(a,abs(b-753));
  
  }
cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'N' was not declared in this scope
    7 |   for(int i=0;i<N-3;i++){
      |                 ^
a.cc:8:15: error: 'A' was not declared in this scope
    8 |   int b= (int)A[i]*100+(int)A[i+1]*10+(int)A[i];
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <iomanip>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define L(ID) ((ID*2)+1)
#define R(ID) ((ID*2)+2)
#define M(L,R) ((L+R)/2)
#define forr(start,end) for(int i = start; i < end; i++)
#define gap ' '

const int MAXN = 200;
//ll a[MAXN], ST[MAXN * 4], LZ[MAXN*4];

/*bool perfectSquare(ll x){
    ll s = sqrt(x);
    if(s *s == x) return true;
    else return false;
}*/
typedef long double ld;

int main() { 
    string s;
    cin >> s;
    int ans = INT_MAX;
    for(int i = 0; i < s.length(); ++i){
        string t = s.substr(i,3);
        int n = stoi(t);
        int k = abs(n - 753);
        ans = min(ans,k);
    }
    cout << ans << endl;
  
    return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'INT_MAX' was not declared in this scope
   31 |     int ans = INT_MAX;
      |               ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <iomanip>
  +++ |+#include <climits>
    7 |
Language: C++

using namespace std;

int main() {

	long long  s;
	scanf("%lld", &s);
	deque<int> deq;
	while(s > 9) {
		deq.push_front(s % 10);
		s = s / 10;
	}
	int ans = 1e9;
	int n = deq.size();
	for(int i = 0; i < n - 3; i++) {
		int a = abs((deq[i] * 100 + deq[i + 1] * 10 + deq[i + 2]) - 753);
		ans = min(a, ans);
	}
	printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'scanf' was not declared in this scope
    6 |         scanf("%lld", &s);
      |         ^~~~~
a.cc:7:9: error: 'deque' was not declared in this scope
    7 |         deque<int> deq;
      |         ^~~~~
a.cc:1:1: note: 'std::deque' is defined in header '<deque>'; this is probably fixable by adding '#include <deque>'
  +++ |+#include <deque>
    1 | using namespace std;
a.cc:7:15: error: expected primary-expression before 'int'
    7 |         deque<int> deq;
      |               ^~~
a.cc:9:17: error: 'deq' was not declared in this scope
    9 |                 deq.push_front(s % 10);
      |                 ^~~
a.cc:13:17: error: 'deq' was not declared in this scope
   13 |         int n = deq.size();
      |                 ^~~
a.cc:15:25: error: 'abs' was not declared in this scope; did you mean 'ans'?
   15 |                 int a = abs((deq[i] * 100 + deq[i + 1] * 10 + deq[i + 2]) - 753);
      |                         ^~~
      |                         ans
a.cc:16:23: error: 'min' was not declared in this scope; did you mean 'main'?
   16 |                 ans = min(a, ans);
      |                       ^~~
      |                       main
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("%d\n", ans);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
string s;
  cin>>s;
  int n=s.length;
  int ans=1000;
  for (int i = 0; i <= n-3; i++) {
    int a = s[i] -'0';
      int b =s[i+1] -'0';
 int c = s[i+2] -'0';
    int x = a*100+b*10+c;
    ans =min(ans,abs(753-x));
    
}

cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    7 |   int n=s.length;
      |           ^~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(S.substr(0,3));
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<S.size()-3;i++){
    if (diff<abs(stoi(S.substr(i,3))-753)){
      diff = abs(stoi(S.substr(i,3))-753);
      val = stoi(S.substr(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |   int diff = abs(stoi(str(0,3))-753);
      |                       ^~~
      |                       std
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(str(0,3));
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<S.size()-3;i++){
    if (diff<abs(stoi(S.substr(i,3))-753)){
      diff = abs(stoi(S.substr(i,3))-753);
      val = stoi(S.substr(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   int val = stoi(str(0,3));
      |                  ^~~
      |                  std
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(str(0,3));
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<S.size()-3;i++){
    if (diff<abs(stoi(S.substr(i,3))-753)){
      diff = abs(stoi(S.sustr(i,3))-753);
      val = stoi(S.substr(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   int val = stoi(str(0,3));
      |                  ^~~
      |                  std
a.cc:14:25: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sustr'; did you mean 'substr'?
   14 |       diff = abs(stoi(S.sustr(i,3))-753);
      |                         ^~~~~
      |                         substr
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(str(0,3));
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<S.size()-3;i++){
    if (diff<abs(stoi(str(i,3))-753)){
      diff = abs(stoi(str(i,3))-753);
      val = stoi(str(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   int val = stoi(str(0,3));
      |                  ^~~
      |                  std
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(str(0,3));
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<N-3;i++){
    if (diff<abs(stoi(str(i,3))-753)){
      diff = abs(stoi(str(i,3))-753);
      val = stoi(str(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   int val = stoi(str(0,3));
      |                  ^~~
      |                  std
a.cc:12:18: error: 'N' was not declared in this scope
   12 |   for (int i=0;i<N-3;i++){
      |                  ^
Language: C++

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

int main() {
  
  string S;
  cin >> S;
  
  int val = stoi(str(0,3);
  int diff = abs(stoi(str(0,3))-753);
  for (int i=0;i<N-3;i++){
    if (diff<abs(stoi(str(i,3))-753)){
      diff = abs(stoi(str(i,3))-753);
      val = stoi(str(i,3));
    }
  }
  
  cout << val << endl;
                 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   int val = stoi(str(0,3);
      |                  ^~~
      |                  std
a.cc:12:18: error: 'N' was not declared in this scope
   12 |   for (int i=0;i<N-3;i++){
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  int N=S.size();
  vector<int>A(N-2);
  for(int i=0;i<N-2;i++){
  string s="";
    for(int j=0;j<3;j++){
    s+=S.at(i+j);
    }
    A.at(i)=stoi(s);
    
  
  }int Min=1000;
  for(int i=0;i<N-2;i++)
    if(abs(A.at(i)-753<=Min)
       Min=abs(A.at(i)-753);
       cout<<Min<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: expected ';' before 'Min'
   17 |     if(abs(A.at(i)-753<=Min)
      |                             ^
      |                             ;
   18 |        Min=abs(A.at(i)-753);
      |        ~~~                   
a.cc:19:23: error: expected ')' before ';' token
   19 |        cout<<Min<<endl;
      |                       ^
      |                       )
a.cc:17:7: note: to match this '('
   17 |     if(abs(A.at(i)-753<=Min)
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string S;
  vector<int>A(N-2);
  for(int i=0;i<N-2;i++){
  string s="";
    for(int j=0;j<3;j++){
    s+=S.at(i+j);
    }
    A.at(i)=stoi(s);
    
  
  }int Min=1000;
  for(int i=0;i<N-2;i++)
    if(abs(A.at(i)-753<=Min)
       Min=abs(A.at(i)-753);
       cout<<Min<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'N' was not declared in this scope
    5 |   vector<int>A(N-2);
      |                ^
a.cc:16:29: error: expected ';' before 'Min'
   16 |     if(abs(A.at(i)-753<=Min)
      |                             ^
      |                             ;
   17 |        Min=abs(A.at(i)-753);
      |        ~~~                   
a.cc:18:23: error: expected ')' before ';' token
   18 |        cout<<Min<<endl;
      |                       ^
      |                       )
a.cc:16:7: note: to match this '('
   16 |     if(abs(A.at(i)-753<=Min)
      |       ^
Language: C++

import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    N = len(S)
    print(min(abs(753 - int(S[n:n + 3])) for n in range(N - 2)))


if __name__ == '__main__':
    main()


Compiler output:
a.cc:26:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   26 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
using ll = long long;
int main() {
string s;
cin >> s;
ll minimum=754;
for(ll i=0;i<s.size()-2,i++){
    ll tmp=(int)s[i]*100+(int)s[i+1]*10+(int)s[i+2];
    minimum=min(minimum,abs(753-tmp));
}
cout << minimum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before ')' token
    9 | for(ll i=0;i<s.size()-2,i++){
      |                            ^
      |                            ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
constexpr long long MOD = 1000000007;
using ll = long long;
int main() {
string s;
cin >> s;
ll minimum=754;
for(ll i=0;i<s.size()-2,i++){
    ll tmp=(int)s[i]*100+(int)s[i+1]*10+(int)s[i+2];
    chmin(minimum,abs(753-tmp));
}
cout << minimum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: expected ';' before ')' token
    9 | for(ll i=0;i<s.size()-2,i++){
      |                            ^
      |                            ;
a.cc:11:5: error: 'chmin' was not declared in this scope
   11 |     chmin(minimum,abs(753-tmp));
      |     ^~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>

int main(int argc, char *argv[]) {
  std::vector<int> a;
  long n;
  std::cin >> n;
  while (n >= 1) {
    a.push_back(n % 10);
    n /= 10;
  }
  std::reverse(a.begin(), a.end());

  int min = INT_MAX;
  for (size_t i = 0; i < a.size() - 2; ++i) {
    int d = a.at(i) * 100 + a.at(i + 1) * 10 + a.at(i + 2);
    min = std::min(min, std::abs(753 - d));
  }
  std::cout << min << std::endl;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:13: error: 'INT_MAX' was not declared in this scope
   15 |   int min = INT_MAX;
      |             ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <vector>
  +++ |+#include <climits>
    4 |
Language: C

#include<stdio.h>
#include<string.h>
int main(void){
  char num[10];
  scanf("%s",num);
  int san[(strlen(num)-2)]={0},i,j,tmp;
  for(i=0;i<(strlen(num)-2);i++){
    for(j=i;j<i+3;j++){
      san[i]+=num[j]-'0';
      san[i]*=10;
    }
    san[i]/=10;
    san[i]-=753;
    if(san[i]<0){
      san[i]*=(-1);
    }
  }
  for(i=0;i<(strlen(num)-2);i++){
    for(j=i+1;j<(strlen(num)-2);j++){
      if(san[i]>san[j]){
        tmp=san[i];
        san[j]=san[i];
        san[i]=tmp;
      }
    }
  }
  printf("%d",san[0]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:28: error: variable-sized object may not be initialized except with an empty initializer
    6 |   int san[(strlen(num)-2)]={0},i,j,tmp;
      |                            ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  ll n = stoi(s);
  
  int digit = 0;
  ll n1 = n;
  while (n1 > 0) {
    n1 /= 10;
    ++digit;
  }
  
  int ans = 999;
  REP(i, digit - 2) {
    ll tmp = n;
    REP(j, i) {
      tmp /= 10;
    }
    tmp %= 1000;
    ans = min(ans, abs(753 - tmp));
  }
  
  cout << ans << endl;
  
  return 0;
}

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

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

int main() {
    string s;
    cin >> s;
    int n = s.size();
    int t = stol(s);
    vector<int> v(n);
    rep(i,n){
        v(i) = t%10;
        t /= 10;
    }
    reverse(v.begin(),v.end());
    int ans = 1000,num = 0;
    rep(i,n-2){
        num = v[i]*100 + v[i+1]*10 + v[i+2];
        ans = min(ans,abs(num-753));
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: no match for call to '(std::vector<int>) (int&)'
   13 |         v(i) = t%10;
      |         ~^~~
Language: C++

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

int main() {
    string s;cin>>s;
    int n = s.size();
    int t = stol(s);
    vector<int> v(n);
    rep(i,n){
        v(i)=t%10;
        t/=10;
    }
    reverse(v.begin(),v.end());
    int ans = 1000,num = 0;
    rep(i,n-2){
        num = v[i]*100 + v[i+1]*10 + v[i+2];
        ans = min(ans,abs(num-753));
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: no match for call to '(std::vector<int>) (int&)'
   12 |         v(i)=t%10;
      |         ~^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    long long s;
    cin >> s;
    int ans = INT_MAX;
    
    while(s!=0) {
        ans = min(ans, abs(753 - s%1000));
        s /= 10;
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'INT_MAX' was not declared in this scope
    9 |     int ans = INT_MAX;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | 
a.cc:12:18: error: no matching function for call to 'min(int&, long long int)'
   12 |         ans = min(ans, abs(753 - s%1000));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:12:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   12 |         ans = min(ans, abs(753 - s%1000));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:12:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |         ans = min(ans, abs(753 - s%1000));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using ll=long long;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int ans = 1001001001;
  rep(i,s.size()-2) {
    int res =0;
    res = (s[i]-'0')*100 + (s[i+1]-'0')*10 + (s[i+2]-'0')*1;
    ans = min(ans, abs(res-753);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: expected ')' before ';' token
   17 |     ans = min(ans, abs(res-753);
      |              ~                 ^
      |                                )
Language: C++

s=input()
a=[]
b=[]
for i in range(0,len(s)-2):
    t=int(s[i]+s[i+1]+s[i+2])
    a.append(abs(753-t))
print(min(a))

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s=input()
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

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

int main(){
    string s;
    cin >> s;
    int n = s.size();
    int ans = INT_MAX;
    rep(i, s.size() - 2){
        int num = 100 * (s[i] - '0') + 10 * (s[i+1] - '0') + (s[i+2] - '0');
        ans = min(abs(num - 753), ans);
    }
    cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'INT_MAX' was not declared in this scope
   16 |     int ans = INT_MAX;
      |               ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<queue>
  +++ |+#include <climits>
    7 |
Language: C++

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

int main(){
  string S;
  cin >> S;
  int dis = 1000000;
  string str = S;
  for(int i = 0; i < S.size(); i++){
    str = S;
   str.substr(i,3);

   int num = atoi(str);
   if(dis > abs(753 - num)){ dis = abs(753 - num); }

  }

  cout << dis << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::substr(size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   11 |    str.substr(i,3);
      |    ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:3208:7: note: declared here
 3208 |       substr(size_type __pos = 0, size_type __n = npos) const
      |       ^~~~~~
a.cc:13:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   13 |    int num = atoi(str);
      |                   ^~~
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

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

int main(){
  string S;
  cin >> S;
  int dis = 1000000;

  for(int i = 0; i < S.size(); i++){
   string str = substr(i,3);

   int num = atoi(str);
   if(dis > abs(753 - num)){ dis = abs(753 - num); }

  }

  cout << dis << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   10 |    string str = substr(i,3);
      |                 ^~~~~~
      |                 strstr
a.cc:12:19: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |    int num = atoi(str);
      |                   ^~~
      |                   |
      |                   std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.nextInt();
    final int LIKE_NUM = 753;
    int min = Integer.MAX_VALUE;
    int ans = 0;
    for(int i=0; i<S.length()-2; i++){
      int tmp = Integer.parseInt(S.substring(i, i+2));
      tmp = Math.abs(tmp - LIKE_NUM);
      ans = Math.min(min, tmp);
    }
    System.out.print(ans);
  }
}

Compiler output:
Main.java:5: error: incompatible types: int cannot be converted to String
    String S = sc.nextInt();
                         ^
1 error