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

/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy[4] = {-1, 0, +1, 0};
int dx[4] = {0, +1, 0, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

//-----------------------ここから-----------


int main(void){
    string s;
    cin >> s;
    ll k;
    cin >> k;

    ll now = 0;
    for(int i = 0; i < s.size(); i++){
        if(k < s.size && s[k - 1] == 1){
            cout << 1 << endl;
            return 0;
        }

        if(s[i] == '1'){
            continue;
        }

        cout << s[i] << endl;
        return 0;
    }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:18: 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 '()' ?)
   49 |         if(k < s.size && s[k - 1] == 1){
      |                ~~^~~~
      |                      ()
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    string S;
    int K,i=0;
    cin >> S >> K;
    while(1){
        if(S[i]!="1"){
            cout << S[i] << endl;
            break;
        }else{
            if(i==K){
                cout << "1" << endl;
                break;
            }else{
                i++;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(S[i]!="1"){
Language: C++

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

int main(){
  string = s;
  ll k;
  cin >> s >> k;
  int bound,num;
  rep(i,s.size()){
    if(s[i] - '0' > 1){
      num = s[i] - '0';
      bound = i;
      break; 
    }
  }
  cout << (k-1 < bound ? 1 : num) << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected unqualified-id before '=' token
    9 |   string = s;
      |          ^
a.cc:11:10: error: 's' was not declared in this scope
   11 |   cin >> s >> k;
      |          ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using ull = unsigned long long;
using ll = long long;
using namespace std;

const ull GOSENTYO = 5e+15;

int main(void) {

    string s;
    ull k;
    cin >> s;
    cin >> k;

    for(size_t i = 0; i < min(k, s.size()); ++i) {
       if(s[i] != '1'){
           cout << s[i] << endl;
           return 0;
       }
    }

    cout << "1" << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: no matching function for call to 'min(ull&, std::__cxx11::basic_string<char>::size_type)'
   19 |     for(size_t i = 0; i < min(k, s.size()); ++i) {
      |                           ~~~^~~~~~~~~~~~~
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:19:30: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   19 |     for(size_t i = 0; i < min(k, s.size()); ++i) {
      |                           ~~~^~~~~~~~~~~~~
/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:19:30: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   19 |     for(size_t i = 0; i < min(k, s.size()); ++i) {
      |                           ~~~^~~~~~~~~~~~~
Language: C++

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

int main() {
	bool b=true;
  	string s;
	cin >> s;
  	unsigned long long k;
	REP(i, k+1) {
		if (s[i] != '1') {
			cout << s[i] << endl;
			b=flase;
          	break;
		}
	}
  	if(b)cout<<1<<endl;
	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: 'flase' was not declared in this scope; did you mean 'fclose'?
   15 |                         b=flase;
      |                           ^~~~~
      |                           fclose
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string a;
int b=0;
int c;
int d=0;
cin>>a;
cin>>c;
for(int i=0;i<1000000000000000000;i++){
if(a.at(i)==1){
b++;
d=i;
}
else
 break;
}
if(b>=c){
	cout<<1;
	else
		cout<<s.at(d+1);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: expected '}' before 'else'
   21 |         else
      |         ^~~~
a.cc:19:9: note: to match this '{'
   19 | if(b>=c){
      |         ^
a.cc:22:23: error: 's' was not declared in this scope
   22 |                 cout<<s.at(d+1);
      |                       ^
a.cc: At global scope:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
string a;
int b=0;
int c;
int d=0;
cin>>a;
cin>>c;
for(int i=0;i<1000000000000000000;i++)
if(a.at(i)==1){
b++;
d=i;
}
else
 break;
}
if(b>=c){
	cout<<1;
	else
		cout<<s.at(d+1);
}

Compiler output:
a.cc:19:1: error: expected unqualified-id before 'if'
   19 | if(b>=c){
      | ^~
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
// 10min
int main(void){
  char s[101];
  char ans[1000000000000000001];
  char tmp[1000000000000000001];
  long int k;
  int ans;

  scanf("%s%d", &s, &k);

  for(500兆日？？){
    
  }
      
  printf("%c\n", ans[k]);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: conflicting types for 'ans'; have 'int'
   11 |   int ans;
      |       ^~~
main.c:8:8: note: previous declaration of 'ans' with type 'char[1000000000000000001]'
    8 |   char ans[1000000000000000001];
      |        ^~~
main.c:15:7: error: invalid suffix "兆日？？" on integer constant
   15 |   for(500兆日？？){
      |       ^~~~~~~~~~~
main.c:15:18: error: expected ';' before ')' token
   15 |   for(500兆日？？){
      |                  ^
      |                  ;
main.c:15:18: error: expected expression before ')' token
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
// 10min
int main(void){
  char s[101];
  char ans[1000000000000000001];
  char ans[1000000000000000001];
  long int k;
  int ans;

  scanf("%s%d", &s, &k);

      
  printf("%c\n", sum[k]);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:8: error: redeclaration of 'ans' with no linkage
    9 |   char ans[1000000000000000001];
      |        ^~~
main.c:8:8: note: previous declaration of 'ans' with type 'char[1000000000000000001]'
    8 |   char ans[1000000000000000001];
      |        ^~~
main.c:11:7: error: conflicting types for 'ans'; have 'int'
   11 |   int ans;
      |       ^~~
main.c:9:8: note: previous declaration of 'ans' with type 'char[1000000000000000001]'
    9 |   char ans[1000000000000000001];
      |        ^~~
main.c:16:18: error: 'sum' undeclared (first use in this function)
   16 |   printf("%c\n", sum[k]);
      |                  ^~~
main.c:16:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    ll k;
    cin >> s >> s;
    k--;
    for (int i = 0; i < s.size(); ++i)
    {
        if (i == k)
            return cout s[i], 0;
        if (s[i] != '1')
            return cout s[i], 0;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: cannot convert 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' in return
   20 |             return cout s[i], 0;
      |                    ^~~~
      |                    |
      |                    std::ostream {aka std::basic_ostream<char>}
a.cc:20:24: error: expected ';' before 's'
   20 |             return cout s[i], 0;
      |                        ^~
      |                        ;
a.cc:20:28: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   20 |             return cout s[i], 0;
      |                            ^
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:1265:7: note: declared here
 1265 |       operator[](size_type __pos)
      |       ^~~~~~~~
a.cc:22:20: error: cannot convert 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' in return
   22 |             return cout s[i], 0;
      |                    ^~~~
      |                    |
      |                    std::ostream {aka std::basic_ostream<char>}
a.cc:22:24: error: expected ';' before 's'
   22 |             return cout s[i], 0;
      |                        ^~
      |                        ;
a.cc:22:28: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   22 |             return cout s[i], 0;
      |                            ^
/usr/include/c++/14/bits/basic_string.h:1265:7: note: declared here
 1265 |       operator[](size_type __pos)
      |       ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
int main(){
    string s;
    ll k;
    cin >> s;
    cin >> k;
    for(ll i=0;i<min(k,(int)s.size());i++){
        char ans = (char)s[i];
        if(s[i]!='1'){cout << ans << endl;}
    }
    cout << 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'min(ll&, int)'
   12 |     for(ll i=0;i<min(k,(int)s.size());i++){
      |                  ~~~^~~~~~~~~~~~~~~~~
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:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 |     for(ll i=0;i<min(k,(int)s.size());i++){
      |                  ~~~^~~~~~~~~~~~~~~~~
/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:3:
/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:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |     for(ll i=0;i<min(k,(int)s.size());i++){
      |                  ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main(){
    string s;
    ll k;
    cin >> s;
    cin >> k;
    for(ll i=0;i<min(k,(int)s.size());i++){
        char ans = (char)s[i];
        if(s[i]!='1'){cout << ans << endl;}
    }
    cout << 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: no matching function for call to 'min(ll&, int)'
   10 |     for(ll i=0;i<min(k,(int)s.size());i++){
      |                  ~~~^~~~~~~~~~~~~~~~~
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:10:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   10 |     for(ll i=0;i<min(k,(int)s.size());i++){
      |                  ~~~^~~~~~~~~~~~~~~~~
/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
Language: C++

#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
int main(){
    string s;
    ll k;
    cin >> s;
    cin >> k;
    for(ll i=0;i<min(k,s.size());i++){
        char ans = (char)s[i];
        if(s[i]!='1'){cout << ans << endl;}
    }
    cout << 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: no matching function for call to 'min(ll&, std::__cxx11::basic_string<char>::size_type)'
   10 |     for(ll i=0;i<min(k,s.size());i++){
      |                  ~~~^~~~~~~~~~~~
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:10:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   10 |     for(ll i=0;i<min(k,s.size());i++){
      |                  ~~~^~~~~~~~~~~~
/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
Language: C++

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

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

    char ans = 'A';
    rep(i, s.size())
    {
        if (s[i] != '1')
        {
            ans = s[i];
            break;
        }
    }

    if (ans == 'A')
        cout << (s.size() > k) ? '' : '1' << endl;
    else
        cout << ans << endl;
    // cout << s << endl;

    return 0;
}

Compiler output:
a.cc:24:34: error: empty character constant
   24 |         cout << (s.size() > k) ? '' : '1' << endl;
      |                                  ^~
a.cc: In function 'int main()':
a.cc:24:43: error: invalid operands of types 'char' and '<unresolved overloaded function type>' to binary 'operator<<'
   24 |         cout << (s.size() > k) ? '' : '1' << endl;
      |                                       ~~~~^~~~~~~
Language: C++

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

int main () {
    string s; cin >> s;
    long long k; cin >> k;
    
    long long index = 0;
    int ans;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != '1') {
            ans = s[i] - '0';
            break;
        }
        index = i;
    }
    if (i <= k) cout << 1 << endl;
    else cout << ans << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     if (i <= k) cout << 1 << endl;
      |         ^
Language: C++

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

int main(){
  string s;
  long long k;
  cin>>s >>k;
  for(int i=0;i<min(s.size(),k);i++){
    if(s[i]>='2'){
      cout<<s[i]<<endl;
      return 0;
    }
  }
  cout<<1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, long long int&)'
    8 |   for(int i=0;i<min(s.size(),k);i++){
      |                 ~~~^~~~~~~~~~~~
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:8:20: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long int')
    8 |   for(int i=0;i<min(s.size(),k);i++){
      |                 ~~~^~~~~~~~~~~~
/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:8:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
    8 |   for(int i=0;i<min(s.size(),k);i++){
      |                 ~~~^~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string

using namespace std;

int main() {
	string s; cin >> s;
	long long k; cin >> k;
	int tmp = 0;
	while (s[tmp] == '1') tmp++;
	if (tmp < k) cout << s[tmp] << endl;
	else cout << 1 << endl;

	return 0;
}

Compiler output:
a.cc:2:17: error: missing terminating > character
    2 | #include <string
      |                 ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>

using namespace std;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++)
typedef long long ll;

int main()
{
    string S,res;
    ll K;
    ll iMin = 999999;
    ll majiImin = 999999;
    ll tmp;


    cin >> S >> K;

    res = '1';

    REP(i,K)
    {
        if(S[i] != '1')res = S[i]
    }

    cout << res << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:34: error: expected ';' before '}' token
   26 |         if(S[i] != '1')res = S[i]
      |                                  ^
      |                                  ;
   27 |     }
      |     ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main() {
	string S; long long K;
	cin >> S >> K;
	for (int i = 0; i < K); i++) {
		if (S[i] >= '2') { cout << S[i] << endl; return 0; }
	}
	cout << '1' << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:30: error: expected ';' before ')' token
    9 |         for (int i = 0; i < K); i++) {
      |                              ^
      |                              ;
a.cc:9:33: error: 'i' was not declared in this scope
    9 |         for (int i = 0; i < K); i++) {
      |                                 ^
Language: C++

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

int main(){
    using namespace std;
    string S;
    cin >> S;
    size_t K;
    cin >> K;
    for(const auto c : S)if(!(c == '1' && --K))return 0 & putchar(c);
    return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include<bits/stdc++.h>
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string ;
  cin >> S;
  for(int i = 0;i < S.size();i++ ){
    if(S.at(i) != 1){
      cout << S.at(i) << endl;
      break;
    }
  }
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: declaration does not declare anything [-fpermissive]
    4 |   string ;
      |   ^~~~~~
a.cc:5:10: error: 'S' was not declared in this scope
    5 |   cin >> S;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S,
  cin >> S;
  for(int i = 0;i < S.size() ;i++ ){
    if(S.at(i) != 1){
      cout << S.at(i) << endl;
      break;
    }
  }
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected initializer before '>>' token
    5 |   cin >> S;
      |       ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int S,
  cin >> S;
  for(int i = 0;i < S.size() ;i++ ){
    if(S.at(i) != 1){
      cout << S.at(i) << endl;
      break;
    }
  }
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected initializer before '>>' token
    5 |   cin >> S;
      |       ^~
a.cc:6:23: error: request for member 'size' in 'S', which is of non-class type 'int'
    6 |   for(int i = 0;i < S.size() ;i++ ){
      |                       ^~~~
a.cc:7:10: error: request for member 'at' in 'S', which is of non-class type 'int'
    7 |     if(S.at(i) != 1){
      |          ^~
a.cc:8:17: error: request for member 'at' in 'S', which is of non-class type 'int'
    8 |       cout << S.at(i) << endl;
      |                 ^~
Language: C++

#include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
  string s,t;
  cin >> s >> t;
  
  if(t.length() >= 3 && t != "100"){
    char ans = '1';
    for(int i=0;i<s.length();i++){
      if(s[i] != '1')
        ans = s[i];
    }
  }
  
  else{
    char 'ans' = '1';
    for(int i=0;i< min(s.length(),stoi(t));i++){
      if(s[i] != '1')
        ans = s[i];
    }
  }
  
  cout << ans << endl;
  
  return 0;
}
  
  

Compiler output:
a.cc:19:10: warning: multi-character character constant [-Wmultichar]
   19 |     char 'ans' = '1';
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:19:10: error: expected unqualified-id before '\x616e73'
a.cc:20:23: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, int)'
   20 |     for(int i=0;i< min(s.length(),stoi(t));i++){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~
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:20:23: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   20 |     for(int i=0;i< min(s.length(),stoi(t));i++){
      |                    ~~~^~~~~~~~~~~~~~~~~~~~
/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
a.cc:22:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |         ans = s[i];
      |         ^~~
      |         abs
a.cc:26:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main(){
  char s[102];
  int i, slen, k, ans, count=0;
  cin >> s >> k;
  slen=strlen(s);
  for(i=0; i<slen; i++){
    if(s[i]=='1') count++;
    else {
      ans=s[i]-'0';
      break;}
  }
    if(count>=k) cout << 1;
    else cout << ans;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: expected '}' at end of input
   19 |     return 0;
      |              ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int main(){
  char s[], k[];
  int i, slen, ans, count=0;
  cin >> s >> k;
  slen=strlen(s);
  for(i=0; i<slen; i++){
    if(s[i]=='1') count++;
    else {
      ans=s[i]-'0';
      break;}
  }
    if(count>k) count << 1;
    else cout << ans;
    return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: storage size of 's' isn't known
    7 |   char s[], k[];
      |        ^
a.cc:7:13: error: storage size of 'k' isn't known
    7 |   char s[], k[];
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  int K;
  cin >> S >> K;
  bool a = false;
  bool b = true;
  for(int i=0;i<S.size();i++){
    if(S.at(i)!='1'&&b){
      cout << S.at(i) << endl;
      b =false;
      if(i==K-2){
        a = true;
      }
    }else if(a){
      cout << 1 << endl;
    }
  }


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

#include <bits/stdc++.h>

using namespace std;

int main(){
	string S;
	long long int K;
	cin >> S;
	cin >> K;
	for(i=0;i<100;i++){
		if(S[i]!='1'){cout << S[i] << endl;return 0;}
	}
	cout << 1 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'i' was not declared in this scope
   10 |         for(i=0;i<100;i++){
      |             ^
Language: C

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n[12], a;
  for(int i = 0; i < 3; scanf("%d", &a), n[a]++, i++);
  printf("%s\n", (n[5] == 2 && n[7] == 1) ? "YES" : "NO");
  return 0;
}

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

    #include <bits/stdc++.h>
    using namespace std;
    
    
    int main(){
      string str;
      long long k;
      cin >> str >>  k;
      for(long long i = 0 ; i < min(str.length() , k) ; i++){
          if(str[i] != '1'){
              cout << str[i] << endl;
              return 0;
          }
      }
      
      cout << "1" << endl;
      
      
      return 0;
    }

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

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


int main(){
  string str;
  long long k;
  cin >> str >>  k;
  for(long long i = 0 ; i < min(str.length() , k) ; i++){
      if(str[i] != '1'){
          cout << str[i] << endl;
          return 0;
      }
  }
  
  cout << "1" << endl;
  
  
  return 0;
}

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

# coding: utf-8
# Your code here!

S = input()
K = int(input())

cnt = []
for i in range(len(S)):
    cnt.append(1)
    
before = -1
while True:
    l = 0
    for i in range(len(cnt)):
        l += cnt[i]
        cnt[i] = int(S[i]) * cnt[i]

    total = 0
    now = 0
    for i in range(len(cnt)):
        total += cnt[i]
        if total >= K:
            now = i
            break
    
    if before == now:
        break
    before = now
print(S[now])

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:4:1: error: 'S' does not name a type
    4 | S = input()
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;


int main(){
  string S;cin >> S;
  int K;cin >> K;
  int ans = 0;
  if(S[0] == '1'){
    if(K == 1) ans = 1;
    else{
      if(S.size() != 1)ans = S[1] - '0';
      else ans = S[0] - '0';
  }
  else{
    ans = S[0] - '0';
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: expected '}' before 'else'
   20 |   else{
      |   ^~~~
a.cc:14:18: note: to match this '{'
   14 |   if(S[0] == '1'){
      |                  ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;


int main(){
  string S;cin >> S;
  int K;cin >> K;
  int ans = 0;
  if(S[0] == '1'){
    if(K == 1) ans = 1;
    else{
      if(S.size() != 1)ans = S[1] - '0';
      else ans = S[0] - '0'
  }
  else{
    ans = S[0] - '0';
  }
  cout << ans <<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected ';' before '}' token
   18 |       else ans = S[0] - '0'
      |                            ^
      |                            ;
   19 |   }
      |   ~                         
a.cc:20:3: error: expected '}' before 'else'
   20 |   else{
      |   ^~~~
a.cc:14:18: note: to match this '{'
   14 |   if(S[0] == '1'){
      |                  ^
Language: C++

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

int main(){
  string s;
  cin >>s;
  long long K;
  cin >>K;
  if(s.at(0)!='1'){
    cout << s.at(0) <<endl;
    return 0;
    }
  if(K==1){
    cout << s.at(0) <<endl;
    }
  else cout <<s.at(1) << endl;
}

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

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

int main(){
  string S;
  ll K;
  cin >> S >> K;
  for(ll i=0,i<S.size();i++){
    if(S[i]=='1' and i+1!=K) continue;
    if(S[i]=='1' and i+1==K) { cout << S[i] << endl; return 0;};
    if(S[i]!='1'){ cout << S[i] << endl; return 0;}
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected ';' before '<' token
   10 |   for(ll i=0,i<S.size();i++){
      |               ^
      |               ;
a.cc:10:15: error: expected primary-expression before '<' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string s;
  long k;
  cin >> s;
  cin >> k;
  int i;
  int ans;
  if(k < 101){
    for(i = 0;i<k;i++){
      if(s[i] != '1'){
        cout << int(s[i]) << endl;
        return 0;
      }
    }
    cout << 1 << endl;
  }else{
    for(i = 0;i<s.length;i++){
      if(s[i] != '1'){
        cout << int(s[i]) << endl;
        return 0;
      }
    }
    cout << 1 << endl;
  }
}
  

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int K;
  string S;
  cin>>S>>K;
  if(S.at(0)!='1'){
    cout<<S.at(0)<<endl;
  }
  else{
    bool frag=true;
    for(int i=0;i<min(K,S.length());i++){
      if(S.at(i)==0){
      }
      else{
        cout<<S.at(i)<<endl;
        frag=false;
        break;
      }
    }
    if(frag==true){
      cout<<'1'<<endl;
    }
    else{
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: no matching function for call to 'min(int&, std::__cxx11::basic_string<char>::size_type)'
   12 |     for(int i=0;i<min(K,S.length());i++){
      |                   ~~~^~~~~~~~~~~~~~
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:12:22: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   12 |     for(int i=0;i<min(K,S.length());i++){
      |                   ~~~^~~~~~~~~~~~~~
/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:12:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   12 |     for(int i=0;i<min(K,S.length());i++){
      |                   ~~~^~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main()
{string S; long long K;
 cin >> S >> K;
 char c = '1';
 for(long long i = 0; i < min(S.size(),K); i++)
 {if(S[i] != '1'){c = S[i]; break;}}
 
 cout << c <<endl;
 return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, long long int&)'
   11 |  for(long long i = 0; i < min(S.size(),K); i++)
      |                           ~~~^~~~~~~~~~~~
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:11:30: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long int')
   11 |  for(long long i = 0; i < min(S.size(),K); i++)
      |                           ~~~^~~~~~~~~~~~
/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
Language: C++

#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main()
{string S; long long K;
 cin >> S >> K;
 char c = '1';
 for(int i = 0; i < min(S.size(),K); i++)
 {if(S[i] != '1'){c = S[i]; break;}}
 
 cout << c <<endl;
 return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: no matching function for call to 'min(std::__cxx11::basic_string<char>::size_type, long long int&)'
   11 |  for(int i = 0; i < min(S.size(),K); i++)
      |                     ~~~^~~~~~~~~~~~
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:11:24: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long int')
   11 |  for(int i = 0; i < min(S.size(),K); i++)
      |                     ~~~^~~~~~~~~~~~
/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
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int i,n;
  char s[101];
  cin >> s;
  for(i=0;;i++){
    if(s[i]!='1'){
      break;
    }
  }
  cin >> n;
  if(i>=k){
    cout << 1;
  }else{
    cout << s[i];
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'k' was not declared in this scope
   14 |   if(i>=k){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  long long n;
  cin >> s >> n;
  int ans=-1;
  int co=0;
  while(ans<0){
    if(s[i]=='1')
      n--;
    else
      ans=s[i]-'0';
    if(n==0)
      ans=1;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'i' was not declared in this scope
   10 |     if(s[i]=='1')
      |          ^
Language: C++


#include <cstdio>
#include <iostream>
#include <algorithm>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;
typedef long long ll;

char buf[110];

int main(void) {
  ll K;
  cin >> buf >> K;
  int len = strlen(buf);
  int res = 1;
  REP(i, min((ll)len, K)) {
    if(buf[i] != '1') {
      res = buf[i] - '0';
      break;
    }
  }
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'strlen' was not declared in this scope
   14 |   int len = strlen(buf);
      |             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 | #define REP(i, n) for(int i = 0; i < (int)(n); ++i)
Language: Java

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

public class C106 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
        long k = Long.parseLong(sc.next());

        char c[] = s.toCharArray();

        char cs = 0;

        for(int i = 0; i < k; i++){
            if(c[i] != '1'){
                cs = c[i];
                break;
            }
        }

        System.out.println(cs);

        sc.close();
    }
}

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