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

#include <iostream>
using namespace std;

int main() {
	int k;
	cin >> k;
	if(n % 2 == 0)
		return cout << -1, 0;
	string s = "7";
	long long cur_power = 1, cur = 7;
	while(cur % k != 0) {
		cur_power = cur_power * 10 % k;
		cur = cur + 7 * cur_power % k;
		cur %= k;
		s += '7';
	}
	cout << s.size();
}
	


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
    7 |         if(n % 2 == 0)
      |            ^
Language: C++

#include<bits/stdc+.h>
using namespace std;
typedef long long ll;
int main(){
  int K;
  long long amount=0;
  cin>>K:
  for(int i=0;i<1000000;i++){
    amount+=pow(10,i)*7
    if(amount%K==0)cout<<i<<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: Java

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int ans = -1;
		int num = 1;

		for (int i = 1; i <= k; i++) {
			if (num % k == 0) {
				ans = i;
				break;
			}

			num = (((10 % k) * (num % k)) % k + 7 % k) % k;
		}

		System.out.println(ans);

		sc.close();
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
using nmespace std;

int main() {
  int k; cin >> k;
  
  int sevens = 7;
  int cnt = 1;
  while(sevens <= 1000006) {
    if(sevens%k == 0) {
      cout << cnt << endl;
      return 0;
    } else {
      sevens = sevens * 10 + 7;
      cnt++;
    }
  }
  cout << -1 << endl;
  
  return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nmespace'
    2 | using nmespace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   int k; cin >> k;
      |          ^~~
      |          std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |       cout << cnt << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |       cout << cnt << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout << -1 << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout << -1 << endl;
      |                 ^~~~
      |                 std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<iostream>

using namespace std;
int main()
{
int i=0,k,num=0;
cin>>k;
if(k%2==0)
{
cout<<"-1";
}
else
{
for(int i=1;i<=1000;i++)
{
	num=(num*10)+7;
    if((num%k)==0)
	{
	cout<<i;
	break;
	}
}
}
}

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

int k;
  cin >> k;

  if (k % 2 == 0)
  {
    cout << -1;
    return;
  }

  ll num = 0;
  for(int i = 1; i <= k; ++i)
  {
    num = num * 10 + 7;
    num %= k;
    if (num == 0)
    {
      cout << i;
      return;
    }
  }  
  cout << -1;

Compiler output:
a.cc:2:3: error: 'cin' does not name a type
    2 |   cin >> k;
      |   ^~~
a.cc:4:3: error: expected unqualified-id before 'if'
    4 |   if (k % 2 == 0)
      |   ^~
a.cc:10:3: error: 'll' does not name a type
   10 |   ll num = 0;
      |   ^~
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for(int i = 1; i <= k; ++i)
      |   ^~~
a.cc:11:18: error: 'i' does not name a type
   11 |   for(int i = 1; i <= k; ++i)
      |                  ^
a.cc:11:26: error: expected unqualified-id before '++' token
   11 |   for(int i = 1; i <= k; ++i)
      |                          ^~
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << -1;
      |   ^~~~
Language: C++

#include <cstdio>

int main()
{
    int k;
    scanf("%d", &k);
    long long n = 7;
    int a=-1
    int i;
    for (i = 0; i < k; i++) {
        if (n % k == 0) {
            a = 1;
            break;
        } else {
            n = n * 10 + 7;
        }
    }
    printf("%d\n", a);

    return 0;
}

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

#include<stdio.h>
#include<math.h>
int main(){
  long s,t,g=0;
  int i;
  scanf("%ld",&s);
  for(i=0;i<7;i++){
    t=pow(10,i);
      g=7*t+g;
    if(g%s==0){
  printf("%d",i);
      break;
    }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:1: error: expected declaration or statement at end of input
   15 | }
      | ^
Language: C

#include<stdio.h>
#include<math.h>
int main(){
  long s,t,i,g=0;
  scanf("%ld",&s);
  for(i=0;i<7;i++){
    t=pow(10,i);
      g=7*t+g;
    if(g%s==0){
  printf("%d",i);
      break;
    }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:1: error: expected declaration or statement at end of input
   14 | }
      | ^
Language: C

#include<stdio.h>
int main(){
  long s,t,g=0;
  scanf("%ld",&s);
  for(i=0;i<7;i++){
    t=pow(10,i);
      g=7*t+g;
    if(g%s==0){
  printf("%d",i);
      break;
    }
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:7: error: 'i' undeclared (first use in this function)
    5 |   for(i=0;i<7;i++){
      |       ^
main.c:5:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:7: error: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
    6 |     t=pow(10,i);
      |       ^~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'pow'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | int main(){
main.c:6:7: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
    6 |     t=pow(10,i);
      |       ^~~
main.c:6:7: note: include '<math.h>' or provide a declaration of 'pow'
main.c:13:1: error: expected declaration or statement at end of input
   13 | }
      | ^
Language: C++

#include <cstdio>

int main()
{
	scanf("%d", &K);
	int x = 0;
	int ans = -1;
	for (int i = 0; i < K; ++i) {
		x = (10 * x + 7) % K;
		if (x == 0) {
			ans = i + 1;
			break;
		}
	}
	printf("%d\n", ans);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: 'K' was not declared in this scope
    5 |         scanf("%d", &K);
      |                      ^
Language: C++

#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <ctype.h>
#include <climits>
#include <queue>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i = 0; i < (ll)(n); ++i)
template<class T> inline bool chmax(T& a, T b) { if(a < b){ a=b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if(a > b){ a=b; return 1; } return 0;}

int main(){
	ll k;
	cin >> k;
	
	ll i=1;
	if(k%2==0){
		cout << "-1\n";
		return 0;
	}
	while(true){
		if(check(i*k)) break;
		i++;
	}
	
	string s = to_string(i*k);
	ll ans = s.size();
	cout << ans << endl;
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'check' was not declared in this scope
   29 |                 if(check(i*k)) break;
      |                    ^~~~~
Language: Java

import java.util.Scanner;
 
public class Main {
   public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
      
      int K = sc.nextInt();
      String S[];
      S = new String[K];
     
      //7,77,777,7777,77777,777777,....一つ前の配列に[7]を足していく
      for(int i=0; i<K; i++) {
        S[i] += "7";
      }
     
      for(int i=0; i<K; i++) {
        //(S[i] % K == 0)なら配列を整数に変換できていない
        if(S[i] % K == 0) {
          System.out.println(i+1);
        } else {
          System.out.println("-1");
        }
      }
   }
}

Compiler output:
Main.java:18: error: bad operand types for binary operator '%'
        if(S[i] % K == 0) {
                ^
  first type:  String
  second type: int
1 error
Language: C++

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

int main() {
  int K;
  
  cin >> K;
  
  int amari = 7 % K;
  
  for(i, K - 1){
     if(amari == 0){
       cout << i + 1 << endl;
       return 0;
     }
    
    amari = (amari * 10 + 7) % K;
  }
  
  cout << -1 << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i, K - 1){
      |       ^
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
a.cc:22:22: error: expected ')' before '}' token
   22 |   cout << -1 << endl;
      |                      ^
      |                      )
   23 | 
   24 | }
      | ~                     
a.cc:13:6: note: to match this '('
   13 |   for(i, K - 1){
      |      ^
a.cc:24:1: error: expected primary-expression before '}' token
   24 | }
      | ^
Language: C++

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

ll k;

void solve(){
    if (k%2 == 0 || k%5 == 0)
        return cout << "-1\n";
    ll ans = 1;
    ll cur = 7 % k;
    while (cur != 0){
        cur = cur * 10 + 7;
        cur %= k;
        ans++;
    }
    cout << ans << "\n";
}


int main(){
   	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> k;
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:10:21: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |         return cout << "-1\n";
      |                ~~~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll i = (m); i < (n); ++i)
#define REPN(i, m, n) for(ll i = (m); i <= (n); ++i)
#define REPR(i, m, n) for(ll i = (m)-1; i >= (n); --i)
#define REPNR(i, m, n) for(ll i = (m); i >= (n); --i)
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void co(void){cout << '\n';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); co();}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); co();}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
// constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const double PI = acos(-1);

int main(void){
	ll k;
	cin >> k;
	ll n = 0, ans = 0;
	while (n % k) {
		n = (n * 10 + 7) % k;
		ans++;

		if ((double)clock() / CLOCKS_PER_SEC >= 1.9) {
			co(-1);
			return;
		}
	}
	co(ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   68 |                         return;
      |                         ^~~~~~
Language: C++

#include<bits/stdc++.h>
#include <algorithm>
using namespace std;
using int = long long;
typedef vector<int> vi;
//macros
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int mod = 1e9+7;
void solution(){
	int k;
	cin >> k;
	int i = 0;
	for(int j = 1;j<10000000;j++){
			i = 10*i + 7
			i = i%k;
			if(i == 0){
				cout << j << endl;
			}
	}
	cout << -1 << endl;
	return;
}

// void solution(){ //read a whole line from the input, possibly containing spaces
// 	string s;
// 	getline(cin,s);
// }
int main(){
	
    fio; // fast input output
    int t;
    t = 1;
    // cin >> t;
    while(t--){
    	// cout << "Case #" << t  << ": ";
        solution();
    }
    return 0;
};

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'int'
    4 | using int = long long;
      |       ^~~
a.cc: In function 'void solution()':
a.cc:19:37: error: expected ';' before 'i'
   19 |                         i = 10*i + 7
      |                                     ^
      |                                     ;
   20 |                         i = i%k;
      |                         ~
Language: C++

k=int(input())
i=1
if k%7==0:
    while (10**i)%(9*k/7)!=1:
        i+=1

else:
    while (10**i)%(9*k)!=1:
        i+=1



print(i)
                                        
                                        

Compiler output:
a.cc:1:1: error: 'k' does not name a type
    1 | k=int(input())
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

/*
1
4
0011
 */
public class C {

    public static void main(String[] args) {
        FastScanner fs=new FastScanner();
        long n=fs.nextInt();
        long ans=0;
        if (n % 2 == 0 || n % 5 == 0) {
            ans = -1;
            System.out.println(ans);
            return;
        }
        long count = 1;
        long num = 7;
        while (num % n != 0) {
            count++;
            num = (10 * num + 7) % n;
            if (count > (long)1e6) {
                ans = -1;
                System.out.println(ans);
                return;
            }
        }
        System.out.println(count);



        

    }

    static final Random random=new Random();

    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }

    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }


}

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

#include <bits/stdc++.h>
#define FOR(i,a) for(int i=0;i<a;i++)
#define boost ios::sync_with_stdio(0); cin.tie(0);
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	boost;
	int m;
	cin >> m;
	vector<bool> visit[m];
	int cur = 0, ret = -1;
	for (int i = 0; ; ++i) {
		cur = (cur * 10 + 7) % m;
		if (visit[cur]) break;
		visit[cur] = true;
		if (cur == 0) {
			ret = i + 1;
			break;
		}
	}
	cout << ret << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: could not convert 'visit[cur]' from 'std::vector<bool>' to 'bool'
   18 |                 if (visit[cur]) break;
      |                     ~~~~~~~~~^
      |                              |
      |                              std::vector<bool>
a.cc:19:30: error: no match for 'operator=' (operand types are 'std::vector<bool>' and 'bool')
   19 |                 visit[cur] = true;
      |                              ^~~~
In file included from /usr/include/c++/14/vector:67,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_bvector.h:894:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(const std::vector<bool, _Alloc>&) [with _Alloc = std::allocator<bool>]'
  894 |       operator=(const vector& __x)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:894:31: note:   no known conversion for argument 1 from 'bool' to 'const std::vector<bool>&'
  894 |       operator=(const vector& __x)
      |                 ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:926:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::vector<bool, _Alloc>&&) [with _Alloc = std::allocator<bool>]'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:926:26: note:   no known conversion for argument 1 from 'bool' to 'std::vector<bool>&&'
  926 |       operator=(vector&& __x) noexcept(_Bit_alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_bvector.h:952:7: note: candidate: 'std::vector<bool, _Alloc>& std::vector<bool, _Alloc>::operator=(std::initializer_list<bool>) [with _Alloc = std::allocator<bool>]'
  952 |       operator=(initializer_list<bool> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_bvector.h:952:40: note:   no known conversion for argument 1 from 'bool' to 'std::initializer_list<bool>'
  952 |       operator=(initializer_list<bool> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
using namespace std;
 
int main()
{
  int k;
  cin >> k;
 
  if (k % 2 == 0)
  {
    cout << -1 << "\n";
    return 0;
  }
  else
  {
    int count = 1;
    long long num = 7;
    while (count <= 1000000)
    {
      if ((num % k)%7==0){
      count++;
      num = (num * 10 + 7);
    }
  }
  cout << -1 << "\n";
 
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main() {
    long long n;
    cin>>n;
    long long l = n*9;
    if (n%7==0) l /= 7;
    long long ans = -1;
    if (k%2!=0 && k%5!=0) {
        long long left =1;
        for (int i=0;i<l;i++) {
            left =(left*10)%l;
            if (left == 1) {
                ans = i+1;
                break;
            }

        }
    }
    cout<<ans<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'k' was not declared in this scope
    9 |     if (k%2!=0 && k%5!=0) {
      |         ^
Language: Java

//I AM THE CREED
/* //I AM THE CREED
/* package codechef; // don't place package name! */
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.StringTokenizer; 
import java.util.*;
public class HelloWorld{
    public static void main(String[] args) throws IOException 
    { 
  
        Scanner input = new Scanner(System.in);
        while(input.hasNext()){
            int n=input.nextInt();
            int s=7;
            int digits=1;
            HashSet<Integer> remainders=new HashSet<>();
            while(n>s){
                s=(s*10)+7;
                digits++;
            }
            boolean possible=true;
            int prev=s%n;
            remainders.add(prev);
            while(prev!=0){
                int mod=((prev*10)+7)%n;
                digits++;
                if(mod==0){
                    break;
                }
                if(remainders.contains(mod)){
                    possible=false;
                    break;
                }
                remainders.add(mod);
                prev=mod;
            }
            if(possible){
                System.out.println(digits);
                continue;
            }
            System.out.println(-1);
            
            
        }
        
    }
    


}

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

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define all(c) begin(c),end(c)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//最大公約数
ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}
//最小公倍数
ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}
//素因数分解
vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}
 
 
 ll mod=100000007;
 
int main() {
  int k;
  ll ans=0;
  cin>>k;
  if(k%2==0||k%5=0){
    cout<<-1;
  }
  ll num=7%k;
  while(num){
    num=((num*10)+7)%mod;
    num%=k;
    ans++;
  }

  cout<<ans;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:12: error: lvalue required as left operand of assignment
   70 |   if(k%2==0||k%5=0){
      |      ~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define all(c) begin(c),end(c)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//最大公約数
ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}
//最小公倍数
ll lcm(ll x, ll y) {
  return x/gcd(x, y)*y;
}
//素因数分解
vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}
 
 
 ll mod=100000007;
 
int main() {
  int k;
  cin>>k;
  if(k%2==0||k%5=0){
    cout<<-1;
  }
  ll num=7%k;
  while(num){
    num=((num*10)+7)%mod;
    num%=k;
    ans++;
  }

  cout<<ans;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:12: error: lvalue required as left operand of assignment
   69 |   if(k%2==0||k%5=0){
      |      ~~~~~~^~~~~
a.cc:76:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   76 |     ans++;
      |     ^~~
      |     abs
a.cc:79:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   79 |   cout<<ans;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
#include<iomanip>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
using namespace std;
using ll=long long;

int main(){
    int k;
    cin>>k;
    if(k%2==0 || k%5==0){
        cout<<-1<<endl;
        return 0;
    }

    ll sum = 0;
    for(int i=1;i++){
        sum=((sum*10)+7)%k;
        if(sum%k==0){
            cout<<i<<endl;
            return 0;
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:20: error: expected ';' before ')' token
   37 |     for(int i=1;i++){
      |                    ^
      |                    ;
Language: C++

#include<iostream>
#include<iomanip>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
using namespace std;
using ll=long long;

int main(){
    int k;
    cin>>n;
    if(k%2==0 || k%5==0){
        cout<<-1<<endl;
        return 0;
    }

    ll sum = 0;
    for(int i=1;i++){
        sum=((sum*10)+7)%k;
        if(sum%k==0){
            cout<<i<<endl;
            return 0;
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: 'n' was not declared in this scope
   30 |     cin>>n;
      |          ^
a.cc:37:20: error: expected ';' before ')' token
   37 |     for(int i=1;i++){
      |                    ^
      |                    ;
Language: C++

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

int main() {
  int K;cin>>K;
  bool can=false;
  if(K%2==0) can=true;
  else if(K%5==0) can=true;
  if(can) cout<<-1<<endl;
  else{
    int L;
    if(K%7==0) L=9*K/7;
    else L=9K;
    int A=1;
    int i=1;
    while(true){
      A=A*10;
      A=A%L;
      if(A==1) break;
      else if(i==1000000) break;
      i++;
    }
  if(i<1000000) cout<<i<<endl;
  else cout<<-1<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: fixed-point types not supported in C++
   13 |     else L=9K;
      |            ^~
Language: C++

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

int main() {
  int K;cin>>K;
  bool can=false;
  if(K%2==0) bool=true;
  else if(K%5==0) bool=true;
  if(can) cout<<-1<<endl;
  else{
    int L;
    if(K%7==0) L=9*K/7;
    else L=9K;
    int A=1;
    int i=1;
    while(true){
      A=A*10;
      A=A%L;
      if(A==1) break;
      else if(i==1000000) break;
      i++;
    }
  }
  if(i<1000000) cout<<i<<endl;
  else cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected unqualified-id before '=' token
    7 |   if(K%2==0) bool=true;
      |                  ^
a.cc:8:23: error: expected unqualified-id before '=' token
    8 |   else if(K%5==0) bool=true;
      |                       ^
a.cc:13:12: error: fixed-point types not supported in C++
   13 |     else L=9K;
      |            ^~
a.cc:24:6: error: 'i' was not declared in this scope
   24 |   if(i<1000000) cout<<i<<endl;
      |      ^
Language: C

#include<stdio.h>

int main(){
  int k;
  scanf("%d",&k);
  if(k%2==0 || k%5==0){printf("-1");return 0;}
  long ans=1;
  
  for(int i=3;i>0;i++){
    int flag=0;
    if(k%i==0){
      for(j=2;j<i;j++){
        if(i%j==0 || i==7){flag=1;break;}
      }
      if(flag==0){
        if(i==3){ans*=3;}else{
          ans*=i-1;
        }
        for(int a=1;a>0;a++){
          k/=i;
          if(k%i!=0)break;
        }
      }
    }
  }
  
  printf("%ld",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: 'j' undeclared (first use in this function)
   12 |       for(j=2;j<i;j++){
      |           ^
main.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
 long long k;cin>>k;
  if(k==1){
    cout<<"1";
    return 0;
  }else if(k%2==0 || k%5==0){
    cout<<"-1";
    return 0;
  }else {
    int cnt=1,num=7;
    while(1){
      if(num%k==0){
        cout<<cnt;
        return 0;
      }else {
        num = num*10;
        num+=7;
      }
     
    }
}

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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
 long long k;cin>>k;
  if(k==1){
    cout<<"1";
    return 0;
  }else if(k%2==0 || k%5==0){
    cout<<"-1";
    return 0;
  }else {
    int cnt=1,num=7;
    while(1){
      if(num%k==0){
        cout<<cnt;
        return;
      }else {
        num = num*10;
        num+=7;
      }
     
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |         return;
      |         ^~~~~~
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
 long long k;cin>>k;
  if(k==1){
    cout<<"1"<<endl
    return 0;
  }else if(k%2==0 || k%5==0){
    cout<<"-1";
    return 0;
  }else {
    int cnt=1,num=7;
    while(1){
      if(num%k==0){
        cout<<cnt;
        return;
      }else {
        num = num*10;
        num+=7;
      }
     
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before 'return'
    7 |     cout<<"1"<<endl
      |                    ^
      |                    ;
    8 |     return 0;
      |     ~~~~~~          
a.cc:17:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   17 |         return;
      |         ^~~~~~
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main() {
  int K;cin>>K;
  if(K%2==0) cout<<-1<<endl;
  else if(K%5==0) cout<<-1<<endl;
  else if(K==3) cout<<3<<endl;
  else if(K==7) cout<<1<<endl;
  else if(K==11) cout<<6<<endl;
  else if(K==13) cout<<6<<endl;
  else if(K==37) cout<<3<<endl;
  else if(K==101) cout<<4<<endl;
  else if(K==41) cout<<5<<endl;
  else if(K==271) cout<<5<<endl;
  else{
    for(int i=7;i<=1000000;i++){//7がk桁ある数字は(7/9){pow(10,k)-1}
      //7777777=239*4649
      if(



Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected primary-expression at end of input
   19 |       if(
      |          ^
a.cc:19:10: error: expected ')' at end of input
   19 |       if(
      |         ~^
      |          )
a.cc:19:10: error: expected statement at end of input
a.cc:19:10: error: expected '}' at end of input
a.cc:17:32: note: to match this '{'
   17 |     for(int i=7;i<=1000000;i++){//7がk桁ある数字は(7/9){pow(10,k)-1}
      |                                ^
a.cc:19:10: error: expected '}' at end of input
   19 |       if(
      |          ^
a.cc:16:7: note: to match this '{'
   16 |   else{
      |       ^
a.cc:19:10: error: expected '}' at end of input
   19 |       if(
      |          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){
  ll k;
  cin >> k;
  vector<int> v = vector<int>(k, -1);
  v[0] = 0;
  ll a = 0;
  ll idx = 1;
  while(true){
    a = a * 10 + 7;
    a %= k;
    if (v[a] != -1) {
      cout << idx - v[a] << endl;
      return 0;
    } else {
      v[a] = idx;
    }
    idx ++;
  }
  return 0;
}
      
}
f

Compiler output:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
a.cc:28:1: error: 'f' does not name a type
   28 | f
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main(){
  ll k;
  vector<int> v = vector<int>(k, -1);
  v[0] = 0;
  ll a = 0;
  ll idx = 1;
  while(true){
    a = a * 10 + 7;
    a %= k;
    if (v[a] != -1) {
      cout << idx - v[a] << endl;
      return 0;
    } else {
      v[a] = idx;
    }
    idx ++;
  }
  return 0;
}
      
}


Compiler output:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C

#include <bits/stdc++.h>

#define ll long long

const long double PI=acos(-1);

using namespace std;

ll gcd(ll a,ll b)

{

    if(b==0)

        return a;

    else

        return gcd(b,a%b);

}

bool prime(ll x)

{

    if(x==2)

    {

        return true;

    }

    else if(x<2||x%2==0)

    {

        return false;

    }

    else

    {

        for(int i=3;i*i<=x;i+=2) {

            if (x % i == 0) {

                return false;

            }

        }

        return true;

    }

}

int main()

{

  ll z;

  cin>>z;

  ll c=0,r=0,i=0;

  while(i<=1000000)

  {

      i++;

      c=(c*10+7);

      if(c%z==0)

      {

          cout<<i;

          return 0;

      }

  }

      cout<<-1<<endl;

}

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;
long long i=0,k,n;
int main()
{
	cin>>k;
	while(i<100000a0)
	{
		i++;
		n=(n*10+7)%k;
		if(n==0)
		{
			cout<<i;
			return 0;
		}
	}
	cout<<-1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: unable to find numeric literal operator 'operator""a0'
    7 |         while(i<100000a0)
      |                 ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<time.h>
#pragma GCC optimize(2)
#define ll long long
using namespace std;
int main()
{
	ll a,i=0,k;
	cin>>k;
	while(i<=1000009)
	{
		i++;
		n=(n*10+7)%k;
		if(n==0)
		{
			cout<<i;
			return 0;
		}
	}
	cout<<-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'n' was not declared in this scope
   13 |                 n=(n*10+7)%k;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int maxn=1e6+5;
vector<ll> V;
int pre[maxn];
int main() {
    ll k,now=7;
    cin>>k;
    if(__gcd(10,k)!=1) {puts("-1");return 0;}
    for(int i=1;;i++) {
    	// if(i>=k)
    	if(now%k==0) {cout<<i<<endl;break;} 
    	now=(now*10+7)%k;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: no matching function for call to '__gcd(int, ll&)'
   12 |     if(__gcd(10,k)!=1) {puts("-1");return 0;}
      |        ~~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:12:13: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   12 |     if(__gcd(10,k)!=1) {puts("-1");return 0;}
      |        ~~~~~^~~~~~
Language: Java

import java.util.*;

public class C {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int K = scanner.nextInt();
		scanner.close();
		long svn = 7;
		boolean flag = false;

		int i = 0;
		while (i < K) {
			i++;
			if (svn % K == 0) { flag = true; break; }
			svn = (svn * 10 + 7) % K;
		}

		if (flag) System.out.println(i);
		else System.out.println(-1);
	}
}

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

#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
#define pb push_back
#define eb emplace_back
int main()
{
    ll n;

    cin>>n;

    ll s=7;

    for(ll i=1;i<=1e6;i++)
    {
        if(s%n==0)
        {
            cout<<i<<endl;
            return 0;
        }

        s=s*10+7;

        s=s%n;

    }
    cout<<-1-<<endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: expected primary-expression before '<<' token
   27 |     cout<<-1-<<endl;
      |              ^~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws NumberFormatException, IOException {
		Integer input = Integer.parseInt((new BufferedReader(new InputStreamReader(System.in))).readLine());
		Integer SEVEN = 7;
		int s=7;
		int counter = 1;
		while(s <= 1000000) {
			if(s%input==0) {
				System.out.println(counter);
			}
			else {
				s = s*10 + SEVEN;
				counter++;
			}	
		}
		if(counter == 7) System.out.println(-1);
	}

Compiler output:
Main.java:21: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include<stdio.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,s=0;
  cin>>n;
  for(i=0;i<=1e7;i++){
  s=s+(s*10+7)%n;
  if(s==0) break;
  }
  cout<<i;
return 0;  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<=1e7;i++){
      |       ^
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout<<i;
      |   ^~~~
a.cc:11:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:9: error: 'i' was not declared in this scope
   11 |   cout<<i;
      |         ^
Language: C++

#include<stdio.h>
using namespace std;
typedef long long ll
int main(){
  ll n,s=0;
  cin>>n;
  for(i=0;i<=1e7;i++){
  s=s+(s*10+7)%n;
  if(s==0) break;
  }
  cout<<i;
return 0;  
}

Compiler output:
a.cc:4:1: error: expected initializer before 'int'
    4 | int main(){
      | ^~~
Language: C++

#include<iostream>
int main()
{
  int K;
  int n=7;
  int i=1;
  std::cin>>K;
  if((K%2)==0){std::cout<<-1;return 0;}
  while()
  {
    n=n*10+7;
    if((n%K)==0){std::cout;return 0;}
    i++;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected primary-expression before ')' token
    9 |   while()
      |         ^
Language: C++

#include<iostream>
int main()
{
  int K;
  int n=7;
  int i=1;
  std::cin>>K;
  if((K%2)==0){td::cout<<-1;return 0;}
  while()
  {
    n=n*10+7;
    if((n%K)==0){std::cout;return 0;}
    i++;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'td' has not been declared
    8 |   if((K%2)==0){td::cout<<-1;return 0;}
      |                ^~
a.cc:9:9: error: expected primary-expression before ')' token
    9 |   while()
      |         ^
Language: C++

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

int main(){
  int K;
  cin >> K;
  int seven = 7;
  if(K % 2 == 0 || K % 5 == 0){
    cout << -1 << endl;
    return;
  }
  for(int i = 0; i < 1000000; i++){
    if(stoi(seven) % K == 0){
      cout << i+1 << endl;
      return 0;
    }
    seven = seven * 10 + 7;
  }
  cout << -1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   10 |     return;
      |     ^~~~~~
a.cc:13:12: error: no matching function for call to 'stoi(int&)'
   13 |     if(stoi(seven) % K == 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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

int main()
{
  int k;
  cin>>k;
  if(k==2)
  {
    cout<<"-1";
    return 0;
  if(k%7==0)
  {
    cout<<"1";
  	return 0;
  }
  int p=7%k;
  for(int i=2;i<=1e6;i++)
  {
    if(((p*(10%k))%k + 7%k)%k ==0)
    {
      for(int j=0;j<i;j++)
        cout<<7;
      return 0;
    }
  }
  cout<<"-1"<<endl;
    return 0;
}

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

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

int main(){
  int K;
  cin >> K;
  int = 7;
  if(K % 2 == 0 || K % 5 == 0){
    cout << -1 << endl;
    return 0;
  }
  int i = 1;
  while(true){
    if(seven % K == 0){
      cout << i << endl;
      break;
    }
    i++;
    seven = seven * 10 + 7;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected unqualified-id before '=' token
    7 |   int = 7;
      |       ^
a.cc:14:8: error: 'seven' was not declared in this scope; did you mean 'setenv'?
   14 |     if(seven % K == 0){
      |        ^~~~~
      |        setenv
a.cc:19:5: error: 'seven' was not declared in this scope; did you mean 'setenv'?
   19 |     seven = seven * 10 + 7;
      |     ^~~~~
      |     setenv
Language: C++

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

int main(){
  int K;
  cin >> K;
  int = 7;
  if(K % 2 == 0 || K % 5 == 0){
    cout << -1 << endl;
    return 0;
  }
  int i = 1;
  while(true){
    if(stoi(seven) % K == 0){
      cout << i << endl;
      break;
    }
    i++;
    seven = seven * 10 + 7;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected unqualified-id before '=' token
    7 |   int = 7;
      |       ^
a.cc:14:13: error: 'seven' was not declared in this scope; did you mean 'setenv'?
   14 |     if(stoi(seven) % K == 0){
      |             ^~~~~
      |             setenv
a.cc:19:5: error: 'seven' was not declared in this scope; did you mean 'setenv'?
   19 |     seven = seven * 10 + 7;
      |     ^~~~~
      |     setenv
Language: Java

import java.util.Scanner;

public class Respect {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int K = sc.nextInt();//好きな数字
		//
		long num = 7;
		int ans = -1;
		for (int i = 1; i <= K; i++) {
			if (num % K == 0) {
				ans = i;
				break;
			}
			num=num*10+7;
		}
		System.out.println(ans);

	}

}


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

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

int main(){
  int K;
  cin >> K;
  string seven = "";
  for(int i = 0; i < 2147483647; i++){
    seven += "7";
    if(stoi(seven) % K == 0){
      cout << i+1 << endl;
      return;
    }
  }
  cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   12 |       return;
      |       ^~~~~~
Language: C++

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

int main(){
  int K;
  cin >> K;
  string seven = "";
  for(int i = 0; i < 2147483647; i++){
    seven += "7";
    if(stoi(seven) % K == 0){
      cout << i+1 << endl;
    }
  }
  cout << -1 << endl;

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

#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>


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

#include<bits/stdc++.h>

using namespace std;

int main(){
    int K,p=7,c=0;
    cin >> K;
    if(K%2==0||K%5==0){
        cout << -1 << endl;
        return 0;
    }
    else{
         while(true){
            c++;
            if(p%K==0)break;
            p += 10*p;
        }
        cout << c << endl;
        return 0;
    }
}

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