criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
 	 long K = sc.nextInt();
 	 int R = -1;
	 long Ar = 7;
     long =1;
    if(K%2!=0){
	 while(i<=K){
   	 	if(Ar%K == 0){
    	  R = i;
          i = K+1;
        }else{
    	  Ar+= 7*Math.pow(10,i);
          i++;
    	}
	  }
    }
  	  System.out.println(R);
  }
}

Compiler output:
Main.java:9: error: not a statement
     long =1;
     ^
Main.java:9: error: ';' expected
     long =1;
         ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K;
  cin >> K;
  int i=1;
  int N=7;
  int ans;
  do{
    if(N%K==0) {
      ans=i;
      break;
    };
    else if(K%2==0){
      ans =-1;
      break;
    };
    else{
      N=N*10+7;
      i++;
    };
  }while(i>=111111);
  cout << i <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else if(K%2==0){
      |     ^~~~
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else{
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> K;
      |         ^~~
a.cc:8:17: error: 'cout' was not declared in this scope
    8 |                 cout << -1 << endl;
      |                 ^~~~
a.cc:8:31: error: 'endl' was not declared in this scope
    8 |                 cout << -1 << endl;
      |                               ^~~~
a.cc:12:17: error: 'cout' was not declared in this scope
   12 |                 cout << i << endl;
      |                 ^~~~
a.cc:12:30: error: 'endl' was not declared in this scope
   12 |                 cout << i << endl;
      |                              ^~~~
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
 	 long K = sc.nextInt();
 	 int R = -1;
	 int Ar = 7;
     int i =1;
    if(K%2!=0){
	 while(i<=K){
   	 	if(Ar%K == 0){
    	  R = i;
          i = K+1;
        }else{
    	  Ar+= 7*Math.pow(10,i);
          i++;
    	}
	  }
    }
  	  System.out.println(R);
  }
}

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from long to int
          i = K+1;
               ^
1 error
Language: Java

import java.io.BufferedReader; 
import java.io.*;
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.math.*;
public class Main 
{ 
    static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader()
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next()
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine();
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
   public static void main(String args[])
    {
        FastReader sc=new FastReader();
        PrintWriter pw=new PrintWriter(System.out);
        int t=1;//sc.nextInt();
        long ans=0,mod=7,k=sc.nextLong(),te=0;
        while(mod<=77777777777777777)
        {
         ans++;
         if(mod%k==0){pw.println(ans);te=1;break;}
         mod=10*mod+7;
        }
        if(te==0) pw.println(-1);
           pw.close();
    }
}
  

Compiler output:
Main.java:72: error: integer number too large
        while(mod<=77777777777777777)
                   ^
1 error
Language: C++

/* include c++ libraries */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <queue>
#include <set>

/* include c-lang libraries */
#include <climits>
#include <cmath>

/* include my libraries */
//#include <show_vec.hh>

using namespace std;

#define LINE DEBUG{ printf("LINE : %d\n", __LINE__); }
#define DEBUG if(false)

using ll = long long;
template<class T> using vec = vector<T>;

const int MOD = 1000000007;

int main(){
  int K;
  cin >> K;
  vector<int> mod(K, 0);
  int M = 7;
  int count = 0;
  if(K > 9){
    while(true){
      #printf("M : %d\n", M);
      M = M*10;
      count++;
      if(M%K == 7){
        break;
      }else{
        M = (M%K);
        if(mod[M] == 0){
          mod[M] = 1;
        }else{
          count = -1;
          break;
        }
      }
    }
  }else{
    if(K == 1 || K == 7){
      count = 1;
    }else if(K == 3){
      count = 3;
    }else if(K == 9){
      count = 9;
    }else{
      count = -1;
    }
  }

  cout << count << endl;
  return 0;
}


Compiler output:
a.cc:36:8: error: invalid preprocessing directive #printf
   36 |       #printf("M : %d\n", M);
      |        ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K;
  cin >> K;
  int i=1;
  int N=7;
  int ans;
  do{
    if(N%K==0) {
      ans=i;
      break;
    };
    else if(K%2==0){
      ans =-1;
      break;
    };
    else{
      N=N*10+7;
      i++;
    }
  }while(i>=111111);
  cout << i <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'else' without a previous 'if'
   15 |     else if(K%2==0){
      |     ^~~~
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else{
      |     ^~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define pb(x) push_back(x)
#define gcd(a,b) __gcd(a,b)
#define all(v) v.begin(),v.end()
#define lcm(a,b) (a*b)/gcd(a,b)
#define bits(x) __builtin_popcountll(x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int32_ main()
{
	int k,ans;
	cin>>k;
	if(k%2==0)
	{
		cout<<"-1";
	}
	else
	{
		for(int i=7;;i=(i*10)+7)
		{
			if(i%k==0)
			{
				ans=i;
				break;
			}
		}
		int x=floor(log10(ans)+1);
		cout<<x;
	}
}


Compiler output:
a.cc:12:1: error: 'int32_' does not name a type; did you mean 'int32_t'?
   12 | int32_ main()
      | ^~~~~~
      | int32_t
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define pb(x) push_back(x)
#define gcd(a,b) __gcd(a,b)
#define all(v) v.begin(),v.end()
#define lcm(a,b) (a*b)/gcd(a,b)
#define bits(x) __builtin_popcountll(x)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
int_32 main()
{
	int k,ans;
	cin>>k;
	if(k%2==0)
	{
		cout<<"-1";
	}
	else
	{
		for(int i=7;;i=(i*10)+7)
		{
			if(i%k==0)
			{
				ans=i;
				break;
			}
		}
		int x=floor(log10(ans)+1);
		cout<<x;
	}
}


Compiler output:
a.cc:12:1: error: 'int_32' does not name a type
   12 | int_32 main()
      | ^~~~~~
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
 	 int K = sc.nextInt();
 	 String R = "-1";
	 int Ar = 7;
     int i =1;
	 while(i<=K){
   	 	if(Ar%K == 0){
    	  R = i;
          i = K+1;
        }else{
    	  Ar+= 7*Math.pow(10,i);
          i++;
    	}
	  }
  	  System.out.println(R);
  }
}

Compiler output:
Main.java:12: error: incompatible types: int cannot be converted to String
    	  R = i;
    	      ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define rept(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(v) v.bigin(),v.end()
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
    FAST;
    ll k;
    ll s=0;
    ll ans=-1;
    cin>>k;
    ll n=7000000;
    for(i,n){
        s+=7*pow(10,i);
        if(s%k==0){
            ans=i+1;
            break;
        }
    }
    cout<<ans;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |     for(i,n){
      |         ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
a.cc:26:15: error: expected ')' before '}' token
   26 |     cout<<ans;
      |               ^
      |               )
   27 | 
   28 | }
      | ~              
a.cc:19:8: note: to match this '('
   19 |     for(i,n){
      |        ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
Language: C++

/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

vector<pair<ll,ll>> factor_arr;

void myfactor(ll num){ 
    ll count = 0;   
    while (!(num % 2)) { 
        num >>= 1; count++; 
    }  
    if (count) factor_arr.push_back({2,count}); 
    for (auto i = 3; i <= sqrt(num); i += 2) { 
        count = 0; 
        while (num % i == 0) { 
            count++; 
            num /= i; 
        } 
        if (count) factor_arr.push_back({i,count}); 
    } 
    if (num > 2) factor_arr.push_back({num,1});
}
vector<ll> arr(1000000)
void virus(){
    ll num;
    cin>>num;
    for(auto i:arr){
        if(i%num == 0){ cout<<i+1; return;}
    }
    cout<<-1;
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
    string s = "7";
    for(auto i=0; i<1000000; i++){
        arr[i] = stoll(s);
        s += "7";
    }
    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Compiler output:
a.cc:48:1: error: expected ',' or ';' before 'void'
   48 | void virus(){
      | ^~~~
a.cc: In function 'int32_t main()':
a.cc:76:12: error: 'virus' was not declared in this scope; did you mean 'virtual'?
   76 |            virus();
      |            ^~~~~
      |            virtual
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int last = n%10;
		if (last == 1 || last == 3 || last == 7 || last ==9) {
			int wei = String.valueOf(n).length();
			StringBuilder big = new StringBuilder();
			for (int i = 0; i < wei; i++) {
				big.append("7");
			}
			int yu = Utils.tenMod(big.toString(), n);
			for(int i = wei;i<1000000;i++) {
				if (yu == 0) {
					System.out.println(i);
					return;
				}
				yu = (yu*10+7)%n;
			}
		} else {
			System.out.println(-1);
		}
	}

}


Compiler output:
Main.java:17: error: cannot find symbol
			int yu = Utils.tenMod(big.toString(), n);
			         ^
  symbol:   variable Utils
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define rept(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(v) v.bigin(),v.end()
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main(){
    FAST;
    ll k;
    ll s=0;
    ll ans=-1;
    cin>>k;
    ll n=7000000;
    for(i,n){
        s+=7*pow(10,i)
        if(s%k==0){
            ans=i+1;
            break;
        }
    }
    cout<<ans;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |     for(i,n){
      |         ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
a.cc:26:15: error: expected ')' before '}' token
   26 |     cout<<ans;
      |               ^
      |               )
   27 | 
   28 | }
      | ~              
a.cc:19:8: note: to match this '('
   19 |     for(i,n){
      |        ^
a.cc:28:1: error: expected primary-expression before '}' token
   28 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long seven = 0;
  long K;
  long i = 1;
  cin >> K;
  if(K % 2 == 0){
    cout << -1 << endl;
    return 0;
  }
  while(true){
   seven += 10 * seven + 7;
   sever %= K;
   if(seven == 0){
    cout << i << endl;
    break;
   }
   i++;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:4: error: 'sever' was not declared in this scope; did you mean 'seven'?
   15 |    sever %= K;
      |    ^~~~~
      |    seven
Language: C++

n = int(input())
if n%2==0 or n%5==0:
    print(-1)

ans,c = 0,0

while 1:
    c+=1
    for i in range(10):
        if ((ans%10)+((n%10)*i)%10)%10==1:
            ans += n*i
            #print(ans,i)
            break
    ans = ans//10
    if ans==0:
        break
print(c)

Compiler output:
a.cc:12:14: error: invalid preprocessing directive #print
   12 |             #print(ans,i)
      |              ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <iostream>
using namespace std;

int main(){
    int n;
    while(cin >> n){
        int x=7;
        int total=0;
        while(x%n!=0){
            total+=1;
            x=x*10+7;
        }cout << total << '\n'
    }
}

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

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

int main() {
	int k;
	cin >> k;
	int c=1,a=7%k;
	while(a!=0)
	{
		c++;
		int b=(a*10)+a;
		a=b%k
		if(c==pow(10,7))
		{
			c=-1;
			break;
		}
	}
	cout << c << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: expected ';' before 'if'
   12 |                 a=b%k
      |                      ^
      |                      ;
   13 |                 if(c==pow(10,7))
      |                 ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K;
  cin >> K;
  int i=1;
  int N=7;
  int ans;
  do{
    if(N%K==0) ans=i;
    else{
      ans=-1;
      N=N*10+7;
    }
    i++;
  }while(ans!=-1 || i>100000000);
  cout << i <<endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K;
  cin >> K;
  int i=1;
  int N=7;
  int ans;
  do{
    if(N%K==0) ans=i;
    else{
      ans=-1;
      N=N*10+7;
      i++;
    }
  }while(ans!=-1 || i>=1111111);
  cout << i <<endl;
  return 0;
}


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

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

int main()
{
  ll n;
  cin>>n;
   ll a=7,ans=1,f=0;

     while(a<=k)
       {

           if(a%n==0)
            {f=1;break;}
           a=a*10+7;
           ans++;
       }
  if(f==0)
    cout<<-1;
  else

   cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'k' was not declared in this scope
   12 |      while(a<=k)
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll k;
  cin>>k;
  ll ans = 1;
  ll cur = 10;
  if (k%5==0 || k%2==0|| __gcd(7,k)!=1 && k!=7)
  {cout<<-1<<endl; return 0;}
  while(cur%k !=1)
  {cur*=10;cur%=k;ans++;}
  cout<<ans;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: no matching function for call to '__gcd(int, ll&)'
    9 |   if (k%5==0 || k%2==0|| __gcd(7,k)!=1 && k!=7)
      |                          ~~~~~^~~~~
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:9:31: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
    9 |   if (k%5==0 || k%2==0|| __gcd(7,k)!=1 && k!=7)
      |                          ~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int k;
  cin >> k;
  if (k % 2 == 0) cout << "-1" << endl;
  else 
  {
    int s = 7;
    for (int i = 0; i <= k; i++)
    {
      if (s % k == 0) 
      {
        cout << i << endl;
        break;
      }
      else s = s * 10 + 7;
    }
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    int n=readI();
    if(n%7==0){
      n/=7;
    }
    if(n%2==0||n%==5){
      pl("-1");
      System.exit(0);
    }
    int k=1,m=0;
    for(int i=0;;i++){
      k=k%n;
      m+=k;
      m=m%n;
      if(m==0){
        pl((i+1)+"");
        break;
      }
      k*=10;
    }
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
}


Compiler output:
Main.java:9: error: illegal start of expression
    if(n%2==0||n%==5){
                  ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define uu unsigned
#define io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MOD 1000000007
#define pi pair<int,int>
#define pl pair<ll,ll>
#define mkp make_pair
#define ss second
#define ff first
#define mit(a,b) map<a,b>::iterator
#define sit(a) set<a>::iterator
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define pprint(x) print(x),putchar(' ')
#define fprint(x) print(x),putchar('\n')
#define printcas cout<<"Case "<<cas<<": "
#define _ continue;
#define endl '\n'
#define __ cout<<endl;continue;
#define vec4d(nam,type,a,b,c,d,fix) vector<vector<vector<vector<type>>>> nam(a,vector<vector<vector<type>>>(b,vector<vector<type>>(c,vector<type>(d,fix))))
const ll oo=(1ll<<60);

int main()
{
     io;
    int T=1;
    //T=gi();
    //cin>>T;
    //for(int cas=1;cas<=T;cas++)
    while(T--)
    {
       ll k=gi(),cnt=1;
       ll mod=7;
       if(~k&1||k%10==5)
       {
           cout<<-1;
           _
       }
       while(mod%k&&cnt<10000007){cnt++;mod=(mod*10+7)%k;}
       if(cnt==10000007)cout<<-1;
      else cout<<cnt;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'gi' was not declared in this scope; did you mean 'vi'?
   35 |        ll k=gi(),cnt=1;
      |             ^~
      |             vi
a.cc:42:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   42 |        while(mod%k&&cnt<10000007){cnt++;mod=(mod*10+7)%k;}
      |                     ^~~
      |                     int
a.cc:43:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   43 |        if(cnt==10000007)cout<<-1;
      |           ^~~
      |           int
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll k;
  cin>>k;
  ll ans = 1;
  ll cur = 10;
  if (k%5==0 || k%2==0|| __gcd(7,k)!=1)
  {cout<<-1<<endl; return 0;}
  while(cur%k !=1)
  {cur*=10;cur%=k;ans++;}
  cout<<ans;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: no matching function for call to '__gcd(int, ll&)'
    9 |   if (k%5==0 || k%2==0|| __gcd(7,k)!=1)
      |                          ~~~~~^~~~~
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:9:31: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
    9 |   if (k%5==0 || k%2==0|| __gcd(7,k)!=1)
      |                          ~~~~~^~~~~
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
  	Scanner sc = new Scanner(System.in);
 	 int K = sc.nextInt();
 	 int R = -1;
	  int Ar = 7;
	  for(int i = 0;i<=K;i++){
   	 if(Ar%K == 0){
    	  R = i+1;
  	  }else{
    	  Ar+= 7*Math.pow(10,i+1);
    	}
        System.out,println(R);
	  }
  }
}

Compiler output:
Main.java:15: error: not a statement
        System.out,println(R);
              ^
Main.java:15: error: ';' expected
        System.out,println(R);
                  ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long k,c=0;
  cin>>k;
  if((int)k%2==0)
  {
      cout<<-1<<endl;
      return 0;
  }
  string s="";
  while(1)
  {
      s+='7';
      c++;
      if(stollll(s)%k==0)
      break;
  }
  cout<<c<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'stollll' was not declared in this scope; did you mean 'wcstoll_l'?
   17 |       if(stollll(s)%k==0)
      |          ^~~~~~~
      |          wcstoll_l
Language: C++

#include<iostream>
using namespace std;
typedef long long int ll;
ll a[12]={7,77,777,7777,77777,777777,7777777,77777777,777777777,7777777777,77777777777,777777777777}
int main()
{
  ll k;
  cin>>k;
  ll i=0;
  ll ch=0;
  for(;i<12;i++)
  {
    if(a[i]%k==0&&a[i]>=k)
    {
      cout<<i+1;
      ch=1;
      break;
    }
  }
  if(ch==0)
    cout<<"-1";
}


Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main()
      | ^~~
Language: Java

import java.util.*;
 
class Main{
  public static void main(String[] args){
  	Scanner　sc = new Scanner(System.in);
 	 int K = sc.nextInt();
 	 int R = -1;
	  int Ar = 7;
	  for(int i = 0;i<=K;i++){
   	 if(Ar%K == 0){
    	  R = i+1;
  	  }else{
    	  Ar+= 7*Math.pow(10,i+1);
    	}
	  }
  }
}

Compiler output:
Main.java:5: error: illegal character: '\u3000'
  	Scanner?sc = new Scanner(System.in);
  	       ^
Main.java:5: error: not a statement
  	Scanner?sc = new Scanner(System.in);
  	^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int K;
  cin >> K;
  int i=1;
  int N=7;
  do{
    if(N%K==0) ans=i;
    else{
      ans=-1;
      N=N*10+7;
    }
    i++;
  }while(ans!=-1);
  cout << i <<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     if(N%K==0) ans=i;
      |                ^~~
      |                abs
a.cc:12:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |       ans=-1;
      |       ^~~
      |       abs
a.cc:16:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   }while(ans!=-1);
      |          ^~~
      |          abs
Language: C++

// Author: Amey Bhavsar
// ID: bhavsar
// IDE: Geany/Ubuntu
// Platform: AtCoder Beginner Contest 174

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

typedef long long ll;

#define rep(i,a,b) for(auto i=a;i<b;i++)
#define repD(i,a,b) for(auto i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal
// traversal function to avoid long template definition
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)
//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define MOD 1000000007
// ll fe (ll x, ll y) {
	// ll ans = 1;
	// while (y>0) {
		// if (y&1) {
			// ans = (x*ans) % MOD;
		// }
		// y /= 2;
		// x = (x*x) % MOD;
	// }
	// return (ans % MOD);
// }

// ll modmul(ll a, ll b) {
    // return ((a%MOD) * (b%MOD)) % MOD;
// }

// ll modadd(ll a , ll b){
    // return((a%MOD)+(b%MOD)+MOD)%MOD;
// }

// ll modsub(ll a , ll b){
    // return((a%MOD) - (b%MOD) + MOD)%MOD;
// }
// from math import sqrt, floor, pi, cos, sin, log, log2
// k=int(input())
// if (k%2 == 0):
	// print(-1)
	// exit(0)
// a = 7
// for i in range(10**6):
	// if (a % k == 0):
		// print(i+1)
		// exit(0)
	// a*=10;
	// a+=7;
// print(-1)


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	
	int k;
	cin >> k;
	if (k % 2 == 0 || k%5 == 0) {
		cout << -1 << '\n';
		return 0;
	}
	ll a = 7;
	for (int i=0; i<=15 i++) {
		if (a % k == 0) {
			cout << i+1 << '\n';
			return 0;
		}
		a *= 10;
		a += 7;
	}
	
	
	
	cout << -1 << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:28: error: expected ';' before 'i'
   74 |         for (int i=0; i<=15 i++) {
      |                            ^~
      |                            ;
Language: Java

import java.util.*;
 
class Main (String[] args){
  Scanner　sc = new Scanner(System.in);
  int K = sc.nextInt();
  int R = -1;
  int Ar = 7;
  for(int i = 0;i<=K;i++){
    if(Ar%K == 0){
      R = i+1;
    }else{
      Ar+= 7*Math.pow(10,i+1);
    }
  }
}

Compiler output:
Main.java:3: error: '{' expected
class Main (String[] args){
          ^
Main.java:4: error: illegal character: '\u3000'
  Scanner?sc = new Scanner(System.in);
         ^
Main.java:4: error: <identifier> expected
  Scanner?sc = new Scanner(System.in);
            ^
Main.java:8: error: illegal start of type
  for(int i = 0;i<=K;i++){
  ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                 ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                    ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                      ^
7 errors
Language: C++

#include<iostream>
using namespace std;
typedef long long int ll;
ll a[12]={7,77,777,7777,77777,777777,7777777,77777777,777777777,7777777777,77777777777,777777777777}
int main()
{
  ll k;
  cin>>k;
  ll i=0;
  for(;i<12;i++)
  {
    if(a[i]%k==0&&a[i]>=k)
    {
      cout<<i+1;
      break;
    }
  }
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main()
      | ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)
#define FOR(i, m, n) for(int i = (m); i < (n); i++)
#define INF 1e9
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << x << endl;

using namespace std;
typedef long long ll;

signed main() {
  int k;
  cin >> k;

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

  int index = 1;
  ll base = 7;
  while(true) {
    if(base % k == 0) break;
    base %= k;
    index++;
    base = base * 10 + 7;
    if(index > 10000000) {
      cout << -1 << endl;
      return;
    }
  }

  cout << index << endl;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s;
    s="7"
  int cnt=1;
  bool t=true;
  for(int i=0;i<100000;i++){
    if(atoi(s)%n==0){
      cout << cnt << endl;
      t=false;
      break;
    }else{
      s+="7";
      cnt++;
    }
  }
  if(t)cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected ';' before 'int'
    7 |     s="7"
      |          ^
      |          ;
    8 |   int cnt=1;
      |   ~~~     
a.cc:11:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |     if(atoi(s)%n==0){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:12:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |       cout << cnt << endl;
      |               ^~~
      |               int
a.cc:17:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |       cnt++;
      |       ^~~
      |       int
Language: Java

import java.util.*;

class Main (String[] args){
  Scanner　sc = new Scanner(System.in);
  int K = sc.nextInt();
  int R = -1;
  int Ar = 7;
  for(int i = 0;i<=K;i++){
    if(Ar%K == 0){
      R = i+1;
    }else{
      Ar+= 7*Math.pow(10,i+1);
    }
  }
}

Compiler output:
Main.java:3: error: '{' expected
class Main (String[] args){
          ^
Main.java:4: error: illegal character: '\u3000'
  Scanner?sc = new Scanner(System.in);
         ^
Main.java:4: error: <identifier> expected
  Scanner?sc = new Scanner(System.in);
            ^
Main.java:8: error: illegal start of type
  for(int i = 0;i<=K;i++){
  ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                 ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                    ^
Main.java:8: error: <identifier> expected
  for(int i = 0;i<=K;i++){
                      ^
7 errors
Language: C++

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

int main(){
    int K;
    cin >> K;
    int remainder = 0;
    int digit = 0;
    while(){
      digit++;
      int i = (10 * remainder + 7) % K;
      if (i == remainder) break;
      remainder = i;
    }
    if (remainder == 0) cout << digit << endl;
    else cout << -1 << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main () {
  int K;
  cin >> K;
  if (K % 2 == 0 || K % 5 == 0) {
    cout << -1 << endl;
    return 0;
  }
  int key = 7;
  int ans = 1;
  int kj = 1;
  while (key % K != 0) {
    ans ++;
    kj *= 10;
    kj %= K;
    key += (kj * 7);
    key %= K;
  }
  cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: expected '}' at end of input
   20 |   cout << ans << endl;
      |                       ^
a.cc:3:13: note: to match this '{'
    3 | int main () {
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int n=7, k,count=1;
  cin>>k;
  while(n%k){
  n=n%k*10+7;
  count++;
  if(count>=){count=-1;break;}
  }
  cout<<count;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before ')' token
    9 |   if(count>=){count=-1;break;}
      |             ^
Language: C++

#include<iostream>
#define int long long
using namespace std;
 
int32_t main()
{ 
  int x; cin>>x;
  int m=7;int i=1;
  
  if(x%2==0 || x%5==0)
  {cout<<-1<<endl;}
  
  else {
  
    while(m<=x)
    {m = m*10+7;i++;}
    
    while(true)
    {if(m%x==0){cout<<i<<endl;break;}
     else {m = m*10+7;i++;}
     
    
   }
  
  }
 
return 0;
 
} 
  
#include<iostream>
#define int long long

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

return 0;

} 
  
Submission Info

Compiler output:
a.cc:34:9: error: redefinition of 'int32_t main()'
   34 | int32_t main()
      |         ^~~~
a.cc:5:9: note: 'int32_t main()' previously defined here
    5 | int32_t main()
      |         ^~~~
a.cc:60:1: error: 'Submission' does not name a type
   60 | Submission Info
      | ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define mp make_pair

ll poW(ll x, ll y)
{
	ll res = 1;

	while(y>0)
	{	
		if(y&1)
			res = res*x;
		y = y>>1;
		x= x*x;
	}
	return res;
}

int main()
{
	ll k; cin >> k;
	ll seven[33];
	seven[0] = 7;
	if(7%i == 0)
	{
		cout << 1 << endl;
		return 0;
	}

	forn(i,1,n)
	{
		seven[i] = (7*poW(10,i)) + seven[i-1];
		if(seven[i]/k == 0)
		{
			cout << i+1 << endl;
			return 0;
		}
	}

	cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:14: error: 'i' was not declared in this scope
   27 |         if(7%i == 0)
      |              ^
a.cc:33:18: error: 'n' was not declared in this scope
   33 |         forn(i,1,n)
      |                  ^
a.cc:4:34: note: in definition of macro 'forn'
    4 | #define forn(i,a,b) for(ll i=a;i<b;i++)
      |                                  ^
Language: Java

/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
300iq as writer = Sad!
*/
import java.util.*;
import java.io.*;
import java.math.*;
import java.time.*;

   public class C
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int K = Integer.parseInt(st.nextToken());
         if(K%2 == 0)
            System.out.println(-1);
         else if(true)
         {
            long curr = 7L;
            int res = 1;
            long lol = System.currentTimeMillis();
            while(System.currentTimeMillis()-lol <= 1950)
            {
               curr %= K;
               if(curr == 0)
               {
                  System.out.println(res);
                  return;
               }
               curr = (curr*10)%K+7L;
               res++;
            }
            System.out.println(-1);
         }
         else
            System.out.println(-1);
      }
      public static boolean isPrime(long n) 
      {
          if(n < 2) return false;
          if(n == 2 || n == 3) return true;
          if(n%2 == 0 || n%3 == 0) return false;
          long sqrtN = (long)Math.sqrt(n)+1;
          for(long i = 6L; i <= sqrtN; i += 6) {
              if(n%(i-1) == 0 || n%(i+1) == 0) return false;
          }
          return true;
      }
   }

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

#include<iostream>
#define int long long

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

return 0;

} 
  

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:6:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   int x; cin>>x;
      |          ^~~
      |          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:10:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   {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:10:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   {cout<<-1<<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:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     {if(m%x==0){cout<<i<<endl;break;}
      |                 ^~~~
      |                 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:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |     {if(m%x==0){cout<<i<<endl;break;}
      |                          ^~~~
      |                          std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  long long K;
  cin >> K;
  int i = 0
  while (i < K) {
    int A = 7 * (pow(10, i + 1) - 1) / 9;
    if (A % K == 0)
      break;
    i++
  }
  if (i + 1 == K)
    cout << "-1" << endl;
  else
    cout << i + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'while'
    8 |   while (i < K) {
      |   ^~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

int main(){
  int k; cin>>k;
  if(k%2==0 || k%5==0){
    cout<<-1;
  } else if(k==7){
    cout<<1;
  }else{
    int ans=0;rep7[k+1];
    rep7[1]=7;
    for(int i=2;i<=k;i++){
      rep7[i]=(rep7[i-1]*10+7)%k;
      if(rep7[i]==0){
        ans=i;
        break;
      }
    }
    cout<<ans;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'rep7' was not declared in this scope; did you mean 'rep'?
   25 |     int ans=0;rep7[k+1];
      |               ^~~~
      |               rep
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE( cout << #x" = " << x << endl)
#define PRINT(x) TRACE(printf(x))
#define WATCHR(a, b) TRACE( for(auto c = a; c != b;) cout << *(c++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end()); } )
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define mp make_pair
#define fi first
#define se second

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using pll = pair<ll, ll>;
constexpr ll MOD = 1e9 + 7;

inline ll pow_mod( ll a, ll b, ll mod = MOD) {
    ll res = 1; a %= mod; assert(b >= 0);
    for(;b;b>>=1) {
        if(b&1) res = (res * a) % mod;
        a = (a * a) % mod;
    }
    return res;
}

template<typename T>
inline void remax(T& x, T y) { x = max(x, y); }

template<typename T>
inline void remin(T& x, T y) { x = min(x, y); }

constexpr int ms = 1e6 + 13;

int fd[ms];

int main() 
{
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    if(n % 2 == 0) cout << -1 << '\n';
    else {
        int cur_mod = (7 % n);
        int cur_v = 0;
        fd[cur_mod] = 1; 
        while(cur_mod != 0) {
            cur_mod = (cur_mod * 10 + 7) % n;
            cur_v++;
            if(fd[lg_mod] == 1) break;
            fd[lg_mod] = 1; 
        }
        if(cur_mod == 0) cout << cur_v + 1 << '\n';
        else cout << -1 << '\n';
    }
    return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:57:19: error: 'lg_mod' was not declared in this scope
   57 |             if(fd[lg_mod] == 1) break;
      |                   ^~~~~~
a.cc:58:16: error: 'lg_mod' was not declared in this scope
   58 |             fd[lg_mod] = 1;
      |                ^~~~~~
Language: C++

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

int main() {
  long long K;
  cin >> K;
  for (int i = 0; i < K; i++) {
    A = 7 * (pow(10, i + 1) - 1) / 9;
    if (A % K == 0)
      break;
  }
  if (i + 1 == K)
    cout << "-1" << endl;
  else
    cout << i + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'A' was not declared in this scope
    8 |     A = 7 * (pow(10, i + 1) - 1) / 9;
      |     ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   if (i + 1 == K)
      |       ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<math.h>

#define ll long long
#define ull unsigned long long
#define ld long double
#define fo(i,start,end) for(ll i=start;start<end?i<end:i>end;start<end?i+=1:i-=1)
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vop vector<pll>
#define vov vector<vector<ll>>
using namespace std;
const ld pi=3.14159265358979323;

const long long mod1=1e9+7;
const long long mod2=1e18;
const ll mod3=9e18;
const ll N=1e9+7;

long long power(ll  x, ll n){if(n==0)return 1;ll temp=power(x,n/2);if(n%2==0)return temp*temp;else return x*temp*temp;}

ll gcd(ll a,ll b){if(a<b) return gcd(b,a);if(b==0) return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return (a*b)/(gcd(a,b));}
void swap(int* a, int* b){int t = *a;*a = *b;*b = t;}
bool f(ll x,ll y){return x>y;}
bool cmp(ll x ,ll y){
    return abs(x)<abs(y);
}
ll max(ll a,ll b){return a>b?a:b;}
ll min(ll x,ll  y){return x>y?y:x;}

ll pmod(ll a, ll b,ll mod)//a^b%mod
{
    ll ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%mod;
        b/=2;
        a=(a*a)%mod;
    }
    return ans;
}
int main(){
    int n,i=1;
    cin>>n;
    str="";
    while(true){
        int j=i;
        while(i--)str+='7';
        if(int(str)%k==0){
            cout<<j<<endl;
            break;
        }
        else{
            i=i+1;
            continue;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:5: error: 'str' was not declared in this scope; did you mean 'std'?
   57 |     str="";
      |     ^~~
      |     std
a.cc:61:21: error: 'k' was not declared in this scope
   61 |         if(int(str)%k==0){
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define ll long long;
#define dbg(x) cout<<#x<<"--------------"<<x<<endl;
#define dl cout<<"LINE"<<__LINE__<<endl;
using namespace std;
int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int k;
	cin>>k;
	int mod=7%k;
	if(i==1||i==7){
		cout<<1<<endl;
		exit(0);
	}
	for(int i=1;i<=9999999;i++){
		mod=(mod*10+7)%k;
		if(!mod){
			cout<<i+1<<endl;
			exit(0);
		}
	}
	cout<<-1<<endl;
	
	
	
	
		
	return 0;
}

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

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

int main() {
  long long K;
  cin >> K;
  for (int i = 0; i << K) {
    A = 7 * (10 ** (i + 1) - 1) / 9;
    if (A % K == 0)
      break;
  }
  if (i + 1 == K)
    cout << "-1" << endl;
  else
    cout << i + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before ')' token
    7 |   for (int i = 0; i << K) {
      |                         ^
      |                         ;
a.cc:8:5: error: 'A' was not declared in this scope
    8 |     A = 7 * (10 ** (i + 1) - 1) / 9;
      |     ^
a.cc:8:18: error: invalid type argument of unary '*' (have 'int')
    8 |     A = 7 * (10 ** (i + 1) - 1) / 9;
      |                  ^~~~~~~~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   if (i + 1 == K)
      |       ^