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

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
  string S;cin>>S;
  long long tmp=10000000000;
  string s1;
  long long s2;
  for (int i=0;i<S.size()-2;i++){
    s1=S.subscr(i,3);
    s2=s1-'0';
    tmp=abs(s2-753);
    tmp=min(tmp,s2);
  }
  cout<<tmp<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subscr'; did you mean 'substr'?
   11 |     s1=S.subscr(i,3);
      |          ^~~~~~
      |          substr
a.cc:12:10: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   12 |     s2=s1-'0';
      |        ~~^~~~
      |        |  |
      |        |  char
      |        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 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_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:12:11: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   12 |     s2=s1-'0';
      |           ^~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:12:11: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   12 |     s2=s1-'0';
      |           ^~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string S;cin>>S;
  int tmp=10000000000;
  string s1;
  int s2;
  for (int i=0;i<S.size()-2;i++){
    s1=S.subscr(i,3);
    s2=s1-'0';
    tmp=min(tmp,s2);
  }
  cout<<tmp<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: warning: overflow in conversion from 'long int' to 'int' changes value from '10000000000' to '1410065408' [-Woverflow]
    6 |   int tmp=10000000000;
      |           ^~~~~~~~~~~
a.cc:10:10: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'subscr'; did you mean 'substr'?
   10 |     s1=S.subscr(i,3);
      |          ^~~~~~
      |          substr
a.cc:11:10: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
   11 |     s2=s1-'0';
      |        ~~^~~~
      |        |  |
      |        |  char
      |        std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 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_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:11:11: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   11 |     s2=s1-'0';
      |           ^~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:11:11: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   11 |     s2=s1-'0';
      |           ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  string S;
  int tmp, min;
  
  cin >> S;
  min = 1000;
  for(int i=0; i<S.size()-2; i++) {
    tmp = static_cast<int>S.substr(i,3);
    tmp = abs(tmp-753);
    if(tmp<min) {
      min = tmp;
    }
  }
  
  cout << min << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected '(' before 'S'
   11 |     tmp = static_cast<int>S.substr(i,3);
      |                           ^
      |                           (
a.cc:11:40: error: expected ')' before ';' token
   11 |     tmp = static_cast<int>S.substr(i,3);
      |                                        ^
      |                                        )
a.cc:11:11: error: invalid 'static_cast' from type 'std::__cxx11::basic_string<char>' to type 'int'
   11 |     tmp = static_cast<int>S.substr(i,3);
Language: C++

#include <iostream>
using namespace std;

int main() {
  string S;
  int tmp, min
    ;
  
  cin >> S;
  min = 1000;
  for(int i=0; i<S.size()-2; i++) {
    tmp = static_cast<int>S.substr(i,3);
    tmp = abs(tmp-753);
    if(tmp<min) {
      min = tmp;
    }
  }
  
  cout << min << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected '(' before 'S'
   12 |     tmp = static_cast<int>S.substr(i,3);
      |                           ^
      |                           (
a.cc:12:40: error: expected ')' before ';' token
   12 |     tmp = static_cast<int>S.substr(i,3);
      |                                        ^
      |                                        )
a.cc:12:11: error: invalid 'static_cast' from type 'std::__cxx11::basic_string<char>' to type 'int'
   12 |     tmp = static_cast<int>S.substr(i,3);
Language: C++

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

int main(){
	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(num, ans);
	}
	cout << ans << endl;
}


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

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

#include<cstdio>
#define r(i,n) for(int i=0;i<n;i++)


int main(void){
  string s;
  cin>>s;
  int min=1000000000;
  char x,y,z;

  r(i,s.size()-2){
    x=s.at(i)-'7';
    y=s.at(i+1)-'5';
    z=s.at(i+2)-'3';

  if(min=>abs(x*100)+abs(y*10)+abs(z)){
    min=abs(x*100)+abs(y*10)+abs(z);
  }
  }
  cout<<min<<endl;


return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: expected primary-expression before '>' token
   21 |   if(min=>abs(x*100)+abs(y*10)+abs(z)){
      |          ^
Language: C++

#include <iostream>
#include <cmath>

#define REP(i, a, b) for ( int i = (a); i < (b); i++ )
#define REVREP(i, a, b) for ( int i = (a); i >= (b); i--)
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

using namespace std;

int ans = 1000000000;
char S[12];

int main(void) {
    scanf("%s", S);

    REP(i, 0, strlen(S)-2) {
    	int X = 0;
    	REP(j, 0, 3) X = X * 10 + (S[i+j] - '0');
    	ans = min(ans, abs(753 - X));
    }

    printf("%d\n", ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'strlen' was not declared in this scope
   18 |     REP(i, 0, strlen(S)-2) {
      |               ^~~~~~
a.cc:4:46: note: in definition of macro 'REP'
    4 | #define REP(i, a, b) for ( int i = (a); i < (b); i++ )
      |                                              ^
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cmath>
  +++ |+#include <cstring>
    3 |
Language: C++

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

int main() {
  char s[10];
  gets(s);
  int a[10], i = 0, min = INT_MAX;
  while(s[i] != '\0') {
    a[i] = s[i] - '0';
    i++;
  }
  for (size_t j = 0; j < i-2; j++) {
    int b = a[j] + (a[j+1] * 10) + (a[j+2] * 100);
    b = abs(b - 753);
    min = (b < min) ? b : min;
  }
  printf("%d\n", min);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |   gets(s);
      |   ^~~~
      |   getw
Language: C++

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

int main(){
  string S;
  cin >>S;
 
  int ans = 999;
  int L = S.size()
  rep(i,0,L-3){
    string s = substr(i,3);
    int d = abs(753-stoi(s));
    ans = min(d,ans);
  }
  cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:20: error: expected ',' or ';' before 'for'
    2 | #define rep(i,a,n) for(int i=a;i<=n;i++)
      |                    ^~~
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,0,L-3){
      |   ^~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   rep(i,0,L-3){
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,a,n) for(int i=a;i<=n;i++)
      |                                ^
Language: C++

#include<string>
#include<algorithm>
using namespace std;
int main()
{
 int num=0,a=0,b=10000;
 string s;
 cin >> s;
 for (int i = 0; i < s.length()-2; i++)
 {
  num = 0;
  a = 100;
  for (int j = 0; j < 3; j++)
  {
   num =num+ (s[i + j]-'0') * a;
   a = a /10;
  }
  b = min(abs(num - 753),b);
 }
 cout << b;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: 'cin' was not declared in this scope
    8 |  cin >> s;
      |  ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:20:2: error: 'cout' was not declared in this scope
   20 |  cout << b;
      |  ^~~~
a.cc:20:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    int s = S.length();
    int ans = 753;
    for(int i = 0; i < s-2; i++){
      int n = Integer.parseInt(S.substring(i, i+3));
      int m = Math.abs(753-n);
      ans = m < ans ? min : ans;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
      ans = m < ans ? min : ans;
                      ^
  symbol:   variable min
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()

using namespace std;

int main(){

    ll n;
    cin >> n;

    ll ans = LLONG_MAX+

    while(n >= 100){

        ll tmp = n;

        while(tmp >= 1000){
            tmp = tmp / 10;
        }

        ans = abs(tmp - 753);

        n = n % 10;
    }

    cout << ans << endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected primary-expression before 'while'
   19 |     while(n >= 100){
      |     ^~~~~
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str = sc.next();
      int[] array = new int[str.length()+10];
      int min = 0;
      for(int i = 0;i<str.length()-2;i++){
      	array[i] = Integer.parseInt( str.substring(i,i+3) );
        min = Math.min(max,Math.abs(array[i]-753));
      }
      System.out.println(min);
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
        min = Math.min(max,Math.abs(array[i]-753));
                       ^
  symbol:   variable max
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> int former(const vector<T> &v, T x){
   return upper_bound(v.begin(),v.end(),x) - v.begin() - 1;
}
template<class T> int latter(const vector<T> &v, T x){
    return lower_bound(v.begin(),v.end(),x) - v.begin();
}
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001
#define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010
#define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100
#define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000
#define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000
#define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000
#define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000
#define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;

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



const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	string s;
	cin >> s;
	int ans = INF;
	rep(i,s.size()-2){
		string tmp = "";
		string tmp = s[i] + s[i+1] + s[i+2];
		int num = stoi(tmp);
		chmin(ans,abs(753 - num));
	}                           
	cout << ans << endl;                                    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:24: error: redeclaration of 'std::string tmp'
   56 |                 string tmp = s[i] + s[i+1] + s[i+2];
      |                        ^~~
a.cc:55:24: note: 'std::string tmp' previously declared here
   55 |                 string tmp = "";
      |                        ^~~
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
#define repprev(i,a,b) for(ll i=b-1;i>=a;i--)
#define reprev(i,n) repprev(i,0,n)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T> int former(const vector<T> &v, T x){
   return upper_bound(v.begin(),v.end(),x) - v.begin() - 1;
}
template<class T> int latter(const vector<T> &v, T x){
    return lower_bound(v.begin(),v.end(),x) - v.begin();
}
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define BIT_FLAG_0 (1<<0) // 0000 0000 0000 0001
#define BIT_FLAG_1 (1<<1) // 0000 0000 0000 0010
#define BIT_FLAG_2 (1<<2) // 0000 0000 0000 0100
#define BIT_FLAG_3 (1<<3) // 0000 0000 0000 1000
#define BIT_FLAG_4 (1<<4) // 0000 0000 0001 0000
#define BIT_FLAG_5 (1<<5) // 0000 0000 0010 0000
#define BIT_FLAG_6 (1<<6) // 0000 0000 0100 0000
#define BIT_FLAG_7 (1<<7) // 0000 0000 1000 0000
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;

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



const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);  
	string s;
	cin >> s;
	int ans = INF;
	rep(i,s.size()-2){
		string tmp = s[i] + s[i+1] + s[i+2];
		int num = stoi(tmp);
		chmin(ans,abs(753 - num));
	}                           
	cout << ans << endl;                                    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:44: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   55 |                 string tmp = s[i] + s[i+1] + s[i+2];
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int min=1000000
  for(int i=0;i<s.size()-2;i++){
    string tmp = "aaa";
    tmp[0] = s[i];
    tmp[1] = s[i+1];
    tmp[2] = s[i+2];
    if (min>(stoi(tmp)-753)) min=stoi(tmp)-753;
  }
  cout << min;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int min=1000000
  for(int i=0,i<s.size()-2,i++){
    string tmp = "aaa";
    tmp[0] = s[i];
    tmp[1] = s[i+1];
    tmp[2] = s[i+2];
    if (min>(stoi(tmp)-753)) min=stoi(tmp)-753;
  }
  cout << min;
}

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

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++){
    char c = s.at(i);
    r.at(i) = atoi(c);
  }
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   11 |     r.at(i) = atoi(c);
      |                    ^
      |                    |
      |                    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>
using namespace std;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++){
    int p = atoi(s.at(i));
    r.at(i) = p;
  }
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |     int p = atoi(s.at(i));
      |                  ~~~~^~~
      |                      |
      |                      __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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>
using namespace std;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++)
    r.at(i) = atoi(s.at(i));
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |     r.at(i) = atoi(s.at(i));
      |                    ~~~~^~~
      |                        |
      |                        __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka 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>
using namespace std;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++)
    r.at(i) = stoi(s.at(i));
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   10 |     r.at(i) = stoi(s.at(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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 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 '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} 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 n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++)
    r.at(i) = chartoi(s.at(i));
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'chartoi' was not declared in this scope
   10 |     r.at(i) = chartoi(s.at(i));
      |               ^~~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++)
    r.at(i) = chartoint(s.at(i));
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'chartoint' was not declared in this scope
   10 |     r.at(i) = chartoint(s.at(i));
      |               ^~~~~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> r(n);
  for(int i = 0; i < n; i++)
    r.at(i) = ctoi(s.at(i));
  int a = r.at(0)*100 + r.at(1)*10 + r.at(2) - 753;
  if(a < 0)
    a *= -1;
  for(int i = 1; i < n - 2; i++){
    int b = r.at(i)*100 + r.at(i+1)*10 + r.at(i+2) - 753;
    if(b < 0)
      b *= -1;
    a = min(a, b);
  }
  cout << a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
   10 |     r.at(i) = ctoi(s.at(i));
      |               ^~~~
      |               atoi
Language: C++

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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;
#pragma endregion

#pragma region const
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#pragma endregion

#pragma region util
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}
#pragma endregion

#pragma region init
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

int Main()
{
	string S;
	cin >> S;
	i64 min_diff = 1000;
	REP(i, SIZE(S) - 2)
	{
		i64 diff = abs(753 - atoi(S.substr(i, 3).c_str()));
		if (diff < min_diff)
			min_diff = diff;
	}
	cout << min_diff << 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 <iostream>
#include <math.h>
#include <string>

using namespace std;
#define number 100

int main()
{	
	int ans, i, j, k, a[number] = {0};
	string S;
	cin >> S;

	int len = S.length();
	ans = INT_MAX;
	j = 0;
	for (i = 0; i < len - 2; i++){
		j = (S[i]-'0') * 100 + (S[i + 1]-'0') * 10 + (S[i + 2]-'0');
		if(abs(753-j)<ans)
			ans = abs(753 - j);
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: 'INT_MAX' was not declared in this scope
   15 |         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 <math.h>
  +++ |+#include <climits>
    3 | #include <string>
Language: C++

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

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

    int ans[8];

    int k = 0;

    for(int i = 0; i < 8; i++){
        if(s / 100 == 0){
            break;
        }
        ans[i] = s % 1000;
        s /= 10;
        k++;
    }

    vector<int> abs;

    for(int i = 0; i < k; i++){
        //cout << ans[i] << endl;
        if(753 >= ans[i]){
            abs.push_back(753 - ans[i]);
        }else{
            abs.push_back(ans[i] -753);
        }
    }

    int min = *min_element(abs.begin(), abs.end());

    cout << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'min_element' was not declared in this scope
   33 |     int min = *min_element(abs.begin(), abs.end());
      |                ^~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

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

    int ans[8];

    int k = 0;

    for(int i = 0; i < 8; i++){
        if(s / 100 == 0){
            break;
        }
        ans[i] = s % 1000;
        s /= 10;
        k++;
    }

    int abs[k];

    for(int i = 0; i < k; i++){
        //cout << ans[i] << endl;
        if(753 >= ans[i]){
            abs[i] = 753 - ans[i];
        }else{
            abs[i] = ans[i] -753;
        }
    }

    int min = *min_element(abs, abs + k);

    cout << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'min_element' was not declared in this scope
   32 |     int min = *min_element(abs, abs + k);
      |                ^~~~~~~~~~~
Language: C++

// In His Name

#include <Bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define ll long long
#define gcd __gcd

using namespace std;

typedef pair<int, int> pii;

const int INF = 1e5;
int ans = INF;

int MakeNum (char a, char b, char c){
    int x = a - '0';
    int y = b - '0';
    int z = c - '0';
    int Num = x * 100 + y * 10 + z;
    return (abs (753 - Num));
}

int main(){
	ios_base::sync_with_stdio(0);
	string s;
	cin >> s;
	for (int i = 0 ; i < s.size() - 2 ; i++){
        cout << i << " " << MakeNum(s[i] , s[i+1] , s[i+2]) << endl;
        ans = min (MakeNum(s[i] , s[i+1] , s[i+2]) , ans);
	}
	cout << ans;
}

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

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(void)
{
	int s,a[10],b,i,x,y,z;
	b=0;
	y=10000;
	cin>>s;
	while(1){
		a[b]=s%10
		s=s/10;
		b=b+1;
		if(s<0) break;
	}
	for(i=b;i>=0;i++){
		if(i>2){
			x=a[i]*100+a[i-1]*10+a[i-2];
			y=753-x;
			if(y<0) y=y*(-1);
			if(y<z) z=y;
		}
	}
	cout<<z<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 's'
   12 |                 a[b]=s%10
      |                          ^
      |                          ;
   13 |                 s=s/10;
      |                 ~
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(void)
{
	int s,a[10],b,i,x,y,z;
	b=0;
	y=10000;
	cin>>s;
	while(1){
		a[b]=s%10
		s=s/10;
		b=b+1;
		if(s==0) break;
	}
	for(i=b;i>=0;i++){
		if(i>2){
			x=a[i]*100+a[i-1]*10+a[i-2];
			y=753-x;
			if(y<0) y=y*(-1);
			if(y<z) z=y;
		}
	}
	cout<<z<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 's'
   12 |                 a[b]=s%10
      |                          ^
      |                          ;
   13 |                 s=s/10;
      |                 ~
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(void)
{
	int s,a[10],b,i,x,y,z;
	b=0;
	y=10000;
	cin>>s;
	while(1){
		a[b]=s%10
		s=s/10;
		b=b+1;
	}
	for(i=b;i>=0;i++){
		if(i>2){
			x=a[i]*100+a[i-1]*10+a[i-2];
			y=753-x;
			if(y<0) y=y*(-1);
			if(y<z) z=y;
		}
	}
	cout<<z<<endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before 's'
   12 |                 a[b]=s%10
      |                          ^
      |                          ;
   13 |                 s=s/10;
      |                 ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 string a;
  cin>>a;
  int c=1000;
  for(int i=0;i<a.size()-1;i++){
    if(c>(a.at(i)-'0')*100+(a.at(i+1)-'0')*10+(a.at(i+2)-'0'))
    c=abs((a.at(i)-'0')*100+(a.at(i+1)-'0')*10+(a.at(i+2)-'0')-753)
}
cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:68: error: expected ';' before '}' token
   10 |     c=abs((a.at(i)-'0')*100+(a.at(i+1)-'0')*10+(a.at(i+2)-'0')-753)
      |                                                                    ^
      |                                                                    ;
   11 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 string a;
  cin>>a;
  int c=1000;
  for(int i=0;i<a.size()-1;i++){
    if(c>(a.at(i)-'0')*100+(a.at(i+1)-'0')*10+(a.at(i+2)-'0'))
    c=ans((a.at(i)-'0')*100+(a.at(i+1)-'0')*10+(a.at(i+2)-'0')-753)
}
cout<<c;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B=99999999,C=753;
  string S;cin >> S;
  int D=S.size();
  for(int i=0;i<D-2;i++){
    A=S.substr(i,3);
    A=C-A;
    if(A<0)A*=-1;
    if(B>A)B=A;
  }
  cout << B << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assignment
    8 |     A=S.substr(i,3);
      |       ~~~~~~~~^~~~~
      |               |
      |               std::__cxx11::basic_string<char>
Language: C++

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

int main(){
    string s;
    cin>>s;
    int m=753;
    for(int i=0;i<s.size-2;i++){
        m=min(m,stoi(s.substr(i,3)));
    }
    cout<<m<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |     for(int i=0;i<s.size-2;i++){
      |                   ~~^~~~
      |                         ()
Language: C++

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

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> pint;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

signed main() {
    int S;
    cin>>S;
    int ans=114514;
    for(;S>=100;S/10){
        int a=abs(S%1000-753)<;
        if(abs(S%1000-753)<ans)ans=a;
    }
    cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: expected primary-expression before ';' token
   17 |         int a=abs(S%1000-753)<;
      |                               ^
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <map>
#include <queue>
#include <unordered_map>
#include <bitset>
#include <unordered_set>
#include <stack>
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define eps 1e-7
#define inf 0x3f3f3f3f
#define mod 1000000007
using namespace std;

inline int FastI() {
	char c = ' '; int a = 0;
	while (c < '0' || c > '9') c = _getchar_nolock();
	while ('0' <= c && c <= '9') {
		a = a * 10 + c - '0';
		c = _getchar_nolock();
	}
	return a;
}

int main() {
	speed;
	string s;
	cin >> s;
	int ans = inf;
	for (int i = 0; i < s.size() - 2; ++i) {
		string v = s.substr(i, 3);
		ans = min(ans, abs(753 - atoi(v.c_str())));
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int FastI()':
a.cc:23:40: error: '_getchar_nolock' was not declared in this scope; did you mean 'getchar_unlocked'?
   23 |         while (c < '0' || c > '9') c = _getchar_nolock();
      |                                        ^~~~~~~~~~~~~~~
      |                                        getchar_unlocked
a.cc:26:21: error: '_getchar_nolock' was not declared in this scope; did you mean 'getchar_unlocked'?
   26 |                 c = _getchar_nolock();
      |                     ^~~~~~~~~~~~~~~
      |                     getchar_unlocked
Language: C++

// atcodertemp.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;

int main() 
{
	string s;
	cin >> s;

	int n = s.size();
	int ans = 999;

	for (int i= 0; i <= n-3; i++) {
		int num = (s[i] - '0') * 100 + (s[i + 1] - '0') * 10 + s[i + 2] - '0';
		ans = min(ans, abs(num - 753));

	}
	cout << ans << endl;



}

Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int N = S.length();
		int min = Integer.MAX_VALUE;
		for (int i=0;i<=N-3;i++) {
			String tmp = S.substring(i,i+3);
			int value = Integer.parseInt(tmp);
			min = Math.min(min, Math.abs(value-765));
		}
		SYstem.out.println(min);
	}
}

Compiler output:
Main.java:14: error: package SYstem does not exist
		SYstem.out.println(min);
		      ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   for (int i=0;i<(s.size-3);i++){
      |                   ~~^~~~
      |                         ()
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   for (int i=0;i<s.size-3;i++){
      |                  ~~^~~~
      |                        ()
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                  ^
a.cc:8:27: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                           ^
a.cc:8:37: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                                     ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                  ^
a.cc:8:27: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                           ^
a.cc:8:37: error: invalid types 'int[int]' for array subscript
    8 |         int x = a[i]*100+a[i+1]*10+a[i+2];
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std; 
int main() {
    string S; cin >> S;
    int a=S.size();
    int y=400000;
    for(int i=0;i<a-2;i++) {
        int a = a.at(i)*100+a.at(i+1)*10+a.at(i+2);
        int b=abs(753-a);
        y=min(y,b);
    }
  cout << y << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: request for member 'at' in 'a', which is of non-class type 'int'
    8 |         int a = a.at(i)*100+a.at(i+1)*10+a.at(i+2);
      |                   ^~
a.cc:8:31: error: request for member 'at' in 'a', which is of non-class type 'int'
    8 |         int a = a.at(i)*100+a.at(i+1)*10+a.at(i+2);
      |                               ^~
a.cc:8:44: error: request for member 'at' in 'a', which is of non-class type 'int'
    8 |         int a = a.at(i)*100+a.at(i+1)*10+a.at(i+2);
      |                                            ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: invalid types 'int[int]' for array subscript
    8 |         int a = a[i]*100+a[i+1]*10+a[i+2];
      |                  ^
a.cc:8:27: error: invalid types 'int[int]' for array subscript
    8 |         int a = a[i]*100+a[i+1]*10+a[i+2];
      |                           ^
a.cc:8:37: error: invalid types 'int[int]' for array subscript
    8 |         int a = a[i]*100+a[i+1]*10+a[i+2];
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string a; cin >> a;
  vector<int> x(a.size());
  for(int i=0; i<12;i++){
    int x.at(i)=100*a.at(i)+10*a.at(i+1)+a.at(i+2);
  }
  sort(x.begin(),x.end());
  reverse(x.begin(),x.end());
  int y=x.at(0);
  cout << abs(753-y) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected initializer before '.' token
    7 |     int x.at(i)=100*a.at(i)+10*a.at(i+1)+a.at(i+2);
      |          ^
Language: C++

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

int main(){
  string s; cin>>s;
  int ans;
  for(int i=0;i<s.length()-2;i++){
    string b=s[i]+s[i+1]+s[i+2];
    int k=atoi(b.c_str());
    ans = min(abs(753-k),ans);
  }
  
  cout<<ans<<endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    9 |     string b=s[i]+s[i+1]+s[i+2];
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <stdio.h>

using namespace std;

int main(){
  string S;
  cin >> S;
  int ans=1000;
  for(int i=0; i<S.size()-2; i++){
    string tmp;
    tmp=S[i]+S[i+1]+S[i+2];
   	int nums=stoi(tmp);
    ans=min(ans,tmp);
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'min(int&, std::string&)'
   17 |     ans=min(ans,tmp);
      |         ~~~^~~~~~~~~
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:17:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   17 |     ans=min(ans,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,
                 from a.cc:4:
/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:17:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |     ans=min(ans,tmp);
      |         ~~~^~~~~~~~~
Language: C++

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



  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: request for member 'abs' in 'ans', which is of non-class type 'int'
   13 |     ans=min(ans.abs(753-t));
      |                 ^~~
Language: C++

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



  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: expected ',' or ';' before ':' token
   10 |     int b=s[i+1]-'o':
      |                     ^
a.cc:12:22: error: 'c' was not declared in this scope
   12 |     int t=100*a+10*b+c;
      |                      ^
a.cc:13:17: error: request for member 'abs' in 'ans', which is of non-class type 'int'
   13 |     ans=min(ans.abs(753-t));
      |                 ^~~