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

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

int main(){
  int k;
  cin >> k;
  int x = 7 % k;
  set<int> s;
  while(s.count(x) == 0){
    if(x == 0){
      cout << i << endl;
      return 0;
    }
    s.insert(x);
    x = (x * 10 + 7) % k;
  }
  cout << -1 << endl;
  return 0;
}

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

#include<bits/stdc++.h>
//#define long long ll ;
#define mod 1e+9;
#define rep for(int i=0;i<n;i++);
#define pb push_back;
#define popb pop_back;
using namespace std;
const int ma=1e6+9;
typedef long long ll;

int main()
{
//     #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
   ios_base::sync_with_stdio(0);
    cin.tie(0);
    int k;
    cin >>k;
    ll cnt=0;
    for(int i=1;i<=k;i++)
    {
      cnt=(cnt*10+7)%k;
      if(cnt%k==0)
      {
         break;
      }
    }
    if(i==k)
    {
      if(cnt%k==0)
        cout << i << endl;
      else 
        cout << "-1" << endl;
    }
    else
      cout << i << endl;

  }


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

#include<bits/stdc++.h>
//#define long long ll ;
#define mod 1e+9;
#define rep for(int i=0;i<n;i++);
#define pb push_back;
#define popb pop_back;
using namespace std;
const int ma=1e6+9;
typedef long long ll;

int main()
{
//     #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
   ios_base::sync_with_stdio(0);
    cin.tie(0);
    int k;
    cin >>k;
    ll cnt=0;
    for(int i=1;i<=k;i++)
    {
      cnt=(cnt*10+7)%k;
      if(cnt%k==0)
      {
         break;
      }
    }
    if(i==k)
    cout <<"-1" <<endl;
    else
      cout << i << endl;

  }


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


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

int main(){
    int k;
    int n=1e6+1;
    cin >> k;
    if(k%7==0) k/=7;
    if(k==1){
        cout << 1 << endl;
        cin >> ci;
        return 0;
    }
    int r;
    r = 10%k;
    int ans=1; 
    rep(i, n){
        if(r==1){
            cout << ans << endl;
            cin >> ci;
            return 0;
        }
        r = (10*r)%(9*k);
        ++ans;
    }
    cout << -1 << endl;
    cin >> ci;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'ci' was not declared in this scope
   13 |         cin >> ci;
      |                ^~
a.cc:22:20: error: 'ci' was not declared in this scope; did you mean 'i'?
   22 |             cin >> ci;
      |                    ^~
      |                    i
a.cc:29:12: error: 'ci' was not declared in this scope
   29 |     cin >> ci;
      |            ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
double dist(double x, double y){
 	return sqrt(x*x + y*y); 
}

int main() {
 	ios::sync_with_stdio(false);
  	cin.tie(0);
  
  	unsigned K;
  	cin >> K;
  	ll seq = 7;
  	int count = -1;
  	for(int i = 0; i < K; i++{
     	if(seq % K == 0){
         	count = i + 1;
          	break;
        }
      	seq = seq * 10 + 7;
    }
    cout << count << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ')' before '{' token
   16 |         for(int i = 0; i < K; i++{
      |            ~                     ^
      |                                  )
Language: C++

#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<iomanip>
#include<bits/stdc++.h>
using namespace std;

/*define*/
#define rep(i, n) for(int i=0; i<n; ++i)
#define endl "\n"
typedef long long ll;

const long long mod = 1e18;
const long long INF=1e9;
int ci;

int main(){
    int k;
    int n=1e6+1;
    cin >> k;
    if(k%7==0) k/=7;
    if(k==1){
        cout << ans << endl;
        cin >> ci;
        return 0;
    }
    int r;
    r = 10%k;
    int ans=1; 
    rep(i, n){
        if(r==1){
            cout << ans << endl;
            cin >> ci;
            return 0;
        }
        r = (10*r)%(9*k);
        ++ans;
    }
    cout << -1 << endl;
    cin >> ci;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C

#include <bits/stdc++.h>
 
#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll  = long long;
using pll = pair<ll, ll>;

const ll MOD  = 1e9 + 7;
const ll LINF = 1LL << 62;
const int INF = 1e9 + 7;

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

    ll m = 10;

    if(k % 7 == 0)k /= 7;
    ll base = 9*k;

    rep(i, 10000000){
        m %= 9*k;
        if(m == 1){
            cout << i+1 << endl;
            return 0;
        }
        m *= 10;
    }

    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>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = Long Long;
using P = pair<int, int>;

int main(){
  int k;
  cin >> k;
  int x = 7%k;
  set<int> s;
  for (int i =1; i <= k; ++i){
    if (x==0){
      cout << i << endl;
      return 0;
    }
    x = (x*10+7)%k;
  }
  cout << -1 << endl;
  return 0;
}


Compiler output:
a.cc:4:12: error: 'Long' does not name a type; did you mean 'long'?
    4 | using ll = Long Long;
      |            ^~~~
      |            long
Language: C++

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

int main(){
  int k;
  cin >> k;
  int x = 7%k;
  set<int> s;
  for (int i =1; i <= k; ++i){
    if (x==0){
      cout << i << end1;
      return 0;
    }
    x = (x * 10 +7)%k;
  }
  cout << -1 << end1;
  return 0;
}

Compiler output:
a.cc:4:12: error: 'Long' does not name a type; did you mean 'long'?
    4 | using ll = Long Long;
      |            ^~~~
      |            long
a.cc: In function 'int main()':
a.cc:14:20: error: 'end1' was not declared in this scope
   14 |       cout << i << end1;
      |                    ^~~~
a.cc:19:17: error: 'end1' was not declared in this scope
   19 |   cout << -1 << end1;
      |                 ^~~~
Language: C++

cnt = 1
mod = 7
k = int(input())
for i in range(k):
  if mod%k == 0:
    break
  cnt+=1
  mod = (mod*10 + 7)% k

if mod%k==0:
  print(cnt)
else:
  print(-1)

Compiler output:
a.cc:1:1: error: 'cnt' does not name a type; did you mean 'int'?
    1 | cnt = 1
      | ^~~
      | int
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    int k;
    cin>>k;
    if(k%2==0){
        cout<<"-1";
    }else{
        for(int i=0;i<=1000000;i++){
            if((pow(10,i)+7)%k==0){
                cout<<i+1;
            }else{
                cout<<-1;
            }
            
            
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   17 |             if((pow(10,i)+7)%k==0){
      |                ~~~~~~~~~~~~~^~
      |                          |   |
      |                          |   int
      |                          __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t n;
  cin >> n;
  int64_t L,s=1;
  if(n%7==0){
    L=9*n/7;
    s=10%L;
    for(int64_t i=1;i++){
      if(s==1){
        cout << i << endl;
        break;
      }
      s=((s%L)*10)/L;
    }
  }else{
    L=9*n;
    s=10%L;
    for(int64_t i=1;;i++){
      if(s==1){
        cout << i << endl;
        break;
      }
      s=((s%L)*10)/L;
    }
  }
}
      

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

//c++ テンプレ
#include<bits/stdc++.h>
using namespace std;

typedef long long llint;
typedef long double ld;

#define inf 1e18
#define mod 1000000007
#define sort(v) sort(v.begin(),v.end())
#define reverse(v) reverse(v.begin(),v.end())
#define rep(i,a,n) for(int i=a;i<n;i++)



priority_queue<llint,vector<llint>,greater<llint> > que;
priority_queue<llint> Que;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

void solve(){
    llint k;
    cin >> k;
    llint ans=-1;
    llint x=7%k;
    for(int i=1;i<k+10;i++){
        if(x==0){
            ans=n;
            break;
        }
        x=(10*x+7)%k;
    }
    cout << ans << endl;
}

int main(){
    solve();
    return 0;
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:28:17: error: 'n' was not declared in this scope
   28 |             ans=n;
      |                 ^
Language: C

#include<bits/stdc++.h>
using namespace std;
int k,ans=-1,a;
int main()
{
	cin>>k;
	for(int i=1;i<=k;i++)
	{
		a=a*10+7;
		if(a%k==0)
		{
			ans=i;
			break;
		}
		a%=k;
	}
	cout<<ans;
}

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

package AtcorderBiginnerContest174;

import java.util.HashSet;
import java.util.Scanner;

public class C {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int k = s.nextInt();

		int m = 7 % k;
		int count = 1;
		HashSet<Integer> a = new HashSet<>();  //余りを格納
		a.add(m);

		if(m == 0) {
			System.out.println(count);
			return ;
		}

		while(m != 0) {

			m = (10 * m + 7) % k;
			count++;
			System.out.println(a);

			if(a.contains(m)) {
				System.out.println("-1");
				return ;
			}else {
				a.add(m);
			}

			if(m == 0) {
				System.out.println(count);
				return ;
			}



		}

	}

}


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

int k;
int main(){
    int a = 7;
    int a_pre=0;
    ll ans = 0;
    cin >> k;
    int k10=10%k,k7=7%k;
    while(1){
        ans++;
        a%=k;
        if(a==0)break;
        a_pre=a;
        a = a*k10+k7;
        if(a==a_pre){
            cout<<-1<<endl;
            return 0;
        }
    }
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll ans = 0;
      |     ^~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> k;
      |     ^~~
a.cc:9:9: error: 'ans' was not declared in this scope
    9 |         ans++;
      |         ^~~
a.cc:15:13: error: 'cout' was not declared in this scope
   15 |             cout<<-1<<endl;
      |             ^~~~
a.cc:15:23: error: 'endl' was not declared in this scope
   15 |             cout<<-1<<endl;
      |                       ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << ans <<endl;
      |     ^~~~
a.cc:19:13: error: 'ans' was not declared in this scope
   19 |     cout << ans <<endl;
      |             ^~~
a.cc:19:19: error: 'endl' was not declared in this scope
   19 |     cout << ans <<endl;
      |                   ^~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;

public class Repsept {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Solution sol = new Solution();
		sol.solve(in, out);
		out.close();
	}

	private static class Solution {
		private void solve(InputReader in, PrintWriter out) {
			int k = in.ni(), max = 1000000;
			int n = 0;
			if (k % 2 == 0) {
				out.println(-1);
				return;
			}
			for (int i = 0; i < max; ++i) {
				n = (n * 10 + 7) % k;
				if (n == 0) {
					out.println(i + 1);
					return;
				}
			}
			if (n != 0) {
				out.println(-1);
			}
		}
	}

	private static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		private InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		private String n() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		private int ni() {
			return Integer.parseInt(n());
		}
	}
}

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

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int K;
  int X=0;
  cin >> K;
  rep(i,K){
    X+=7*exp10(i)
    if(X%K==0){return i;}
  }
  return -1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before 'if'
    9 |     X+=7*exp10(i)
      |                  ^
      |                  ;
   10 |     if(X%K==0){return i;}
      |     ~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int K;
  cin >> K;
  rep(i,K){
    if(7*exp10(i)%10==0){return i;}
  }
  return -1
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    8 |     if(7*exp10(i)%10==0){return i;}
      |        ~~~~~~~~~~^~~
      |         |         |
      |         double    int
a.cc:10:12: error: expected ';' before '}' token
   10 |   return -1
      |            ^
      |            ;
   11 | }
      | ~
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main()
{
  int k; cin>>k; int ld=k%10; 
  if(k==1){ cout<<1<<"\n"; return 0; }
  if(ld%2==0||ld=5){ cout<<-1<<"\n"; return 0; }
  int res=7;  if(res%k==0){ cout<<1<<"\n"; }
  for(int i=2;i<=200000000;i++)
  { 
   res=(10*res+7)%k; if(res==0){ cout<<i<<"\n"; return 0; }  
  }
  cout<<-1<<"\n"; return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: lvalue required as left operand of assignment
    7 |   if(ld%2==0||ld=5){ cout<<-1<<"\n"; return 0; }
      |      ~~~~~~~^~~~
Language: Java

package question;

import java.util.Scanner;

public class Question1 {

	public static void main(String[] args) {
		//1 ≦ K ≦ 10^6 の整数を入力
		Scanner sc = new Scanner(System.in);
		System.out.println("1 <= K <= 10^6 の整数を入力してください。");
		// 入力値の取得
		int k = sc.nextInt();
		sc.close();
		//数列の値は全て奇数なので、2 の倍数が登場することはありません。
		if (k % 2 == 0) {
			//入力された数字は偶数の場合、-1を出力
			System.out.println("-1");
			return;
		}
		
		//好きな数字である７を初期化
		int num = 7;
		//何項目を初期化
		int count = 0;

		for(int i=1; i<=k; i++) {
			//ｋの倍数かどうかを判断
			if(num % k == 0) {
				count = i;
				break;
			} 
			//乗余はｋの倍数かどうかを判断
			num = (num * 10 + 7) % k;
		}
		//何項目を出力
		System.out.println(count);
	}
}


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

#include<iostream>

// saw editorial

void correct(){
    int K;
    std::cin>>K;
    if (K%7==0){
        K=K/7;
    }
    if(K%5==0 || K%2==0){
        std::cout<<-1<<std::endl;
        return 0;
    }
    int buf,cnt;
    buf=10;
    cnt=1;
    while(1){
        if(buf%K!=1){
            buf=buf%(9*K);
            buf*=10;
            cnt++;
        }
        else{
            break;
        }
    }
    std::cout<<cnt<<std::endl;
}

int main(){
    correct();
}

Compiler output:
a.cc: In function 'void correct()':
a.cc:13:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |         return 0;
      |                ^
Language: C++

 #include <iostream>
 using namespace std;
 
int main(void) {
   long long  k;
   cin >> k;
   long long amari = k % 7;
 
   for (int i = 1; i <= k; i++) {
     if (x == 0) {
       cout << i << endl;
       return 0;
     }
    
     amari = (x*10 + 7) % k;
   }
  cout << -1 << endl;
   return 0;
 } 


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'x' was not declared in this scope
   10 |      if (x == 0) {
      |          ^
a.cc:15:15: error: 'x' was not declared in this scope
   15 |      amari = (x*10 + 7) % k;
      |               ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll k;
    cin>>k;
    t=0;
    for(int i=1;i<=(1e7);i++)
    {
        t=(t*10+7)%k;
        if(t==0)
        {
            cout<<i;
            return 0;
        }
    }
    cout<<-1;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 't' was not declared in this scope
    8 |     t=0;
      |     ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll k;
    cin>>k;
    t=0;
    for(int i=1;i<=(1e7);i++)
    {
        total=(total*10+7)%k;
        if(total==0)
        {
            cout<<i;
            return 0;
        }
    }
    cout<<-1;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 't' was not declared in this scope
    8 |     t=0;
      |     ^
a.cc:11:9: error: 'total' was not declared in this scope
   11 |         total=(total*10+7)%k;
      |         ^~~~~
Language: C++

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

Compiler output:
a.cc:25:3: error: expected unqualified-id before 'return'
   25 |   return 0;
      |   ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 #definr ll long long
int main()
{
  ll n,c=0;
  cin>>n;
ll k =7;
 ll m=30; 
  while(m--){
if(n%k==0) cout<<c;
  else{
    k = k*10+7;
    c++;
    if(n%k==0) cout<<c;
  }}

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

Compiler output:
a.cc:3:3: error: invalid preprocessing directive #definr; did you mean #define?
    3 |  #definr ll long long
      |   ^~~~~~
      |   define
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll n,c=0;
      |   ^~
a.cc:7:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   cin>>n;
      |        ^
      |        yn
a.cc:8:3: error: expected ';' before 'k'
    8 | ll k =7;
      |   ^~
      |   ;
a.cc:9:4: error: expected ';' before 'm'
    9 |  ll m=30;
      |    ^~
      |    ;
a.cc:10:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |   while(m--){
      |         ^
      |         tm
a.cc:11:6: error: 'k' was not declared in this scope
   11 | if(n%k==0) cout<<c;
      |      ^
a.cc:11:18: error: 'c' was not declared in this scope
   11 | if(n%k==0) cout<<c;
      |                  ^
a.cc:14:5: error: 'c' was not declared in this scope
   14 |     c++;
      |     ^
Language: C++

                         /*  (: ///////|||||| BEGINS |||||||\\\\ :) */
/* REMEMBER
Deletes all characters except first one     Deletes 4 characters from index number 1
    str.erase(1);                               str.erase(1,4);
Deletes character at position 4
 str.erase(str.begin() + 4);
bool compare(const pair<int, int>&a, const pair<int, int>&b)
{
   return a.second<b.second;
}
maxn = max_element(mp.begin(), mp.end(), compare)->second;
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    return (a.second < b.second);
}
priority_queue <int, vector<int>, greater<int>> gquiz; // to create min heap
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl '\n'
const int inf=0x3f3f3f3f;
#define mod  1000000007
#define fo(i,n) for(int i=1;i<=n;i++)
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define three_max(n1,n2,n3) (n1 > n2)?(n1>n3?n1:n3):(n2>n3?n2:n3)
#define lb lower_bound
#define ub upper_bound
#define tr(it, a) for(auto it = a.begin();it!=a.end();it++)
#define gcd(a,b) __gcd(a,b)
#define pq priority_queue 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
long long isprime(long long n)
{
    for(long long i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int 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
ll k;
cin>>k;
ll total=0;
for(ll i=1;i<=1e6;i++)
{

total=(total*10+7)%k;
if(total==0)
{
    cout<<i<<endl;
    return ;
}
}
cout<<-1<<endl;
return 0;
}

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

                         /*  (: ///////|||||| BEGINS |||||||\\\\ :) */
/* REMEMBER
Deletes all characters except first one     Deletes 4 characters from index number 1
    str.erase(1);                               str.erase(1,4);
Deletes character at position 4
 str.erase(str.begin() + 4);
bool compare(const pair<int, int>&a, const pair<int, int>&b)
{
   return a.second<b.second;
}
maxn = max_element(mp.begin(), mp.end(), compare)->second;
bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
{
    return (a.second < b.second);
}
priority_queue <int, vector<int>, greater<int>> gquiz; // to create min heap
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl '\n'
const int inf=0x3f3f3f3f;
#define mod  1000000007
#define fo(i,n) for(int i=1;i<=n;i++)
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define three_max(n1,n2,n3) (n1 > n2)?(n1>n3?n1:n3):(n2>n3?n2:n3)
#define lb lower_bound
#define ub upper_bound
#define tr(it, a) for(auto it = a.begin();it!=a.end();it++)
#define gcd(a,b) __gcd(a,b)
#define pq priority_queue 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
long long isprime(long long n)
{
    for(long long i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int 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
ll k;
cin>>k;
ll total=0;
for(ll i=1;i<=1e6;i++)
{

total=total*10+7;
if(total%k==0)
{
    cout<<i<<endl;
    return ;
}
}
cout<<-1<<endl;
return 0;
}

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

#include <bits/stdc++.h>
using namespace std; 
#define FAST_INP  ios_base::sync_with_stdio(false);cin.tie(NULL)
typedef long long ll; 
const ll MOD = 1000000007;

int main()  
{ 
    FAST_INP;
    int k;
    cin >> k;
    if(k<7) {
    	cout << "-1" << endl;
    	return 0;
	}
	int val=7%k;
	for(int i=1;i<1e7;i++){
		if(val==0){
			cout << i << endl;
			break;
		}
		val=(val*10+7)%mod;
	}
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: 'mod' was not declared in this scope; did you mean 'modf'?
   22 |                 val=(val*10+7)%mod;
      |                                ^~~
      |                                modf
Language: Java

import java.util.Scanner;

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long k  = sc.nextLong();
		long count = 1;
		long m = 7 % k;

		if(k % 2 == 0) {
			System.out.println(-1);
			sc.close();
			return;
		}
		
		while(true) {
			if(m == 0) break;
			
			m *= 10;
			m += 7;
			m %= k;
			count++;
		}
		
		System.out.println(count);
		sc.close();
	}
	
}


package atcoder_174_C;

import java.util.Scanner;

 
public class Main {
 
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		long k  = sc.nextLong();
		long count = 1;
		long m = 7 % k;

		if(k % 2 == 0) {
			System.out.println(-1);
			sc.close();
			return;
		}
		
		while(true) {
			if(m == 0) break;
			
			m *= 10;
			m += 7;
			m %= k;
			count++;
		}
		
		System.out.println(count);
		sc.close();
	}
	
}




Compiler output:
Main.java:35: error: class, interface, enum, or record expected
package atcoder_174_C;
^
Main.java:37: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: C++

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

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


Compiler output:
a.cc:16:3: error: expected unqualified-id before 'return'
   16 |   return 0;
      |   ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

int main(){
  int k,u=0;
  cin >> k;
  for(int i=1;i<=6;i++){
    u=u*10+7;
    if(u%k=0){
      cout << i;
      break;
    }
    if(i=6){
      cout << -1;
  }
  }
  return 0;
}


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

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

int main(){
  int k,u=0;
  cin >> k;
  for(int i=1;i<=6;i++){
    u=u*10+7;
    if(u%k=0){
      cout << i;
      break;
    }
    if(i=6){
      cout << -1;
  }
  }
  return 0;
}

Compiler output:
a.cc: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;

//for loop
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

//abbreviati
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

//constant
const int INF = 1<<30;
const ll INFLL = 1LL << 60;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

/***Snippet***************************************************
ifelse, isprime, torad, todeg, lcm, bfs,chmin,chmax
**************************************************************/

//adjacency list
vector<int> to[100005];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int k;cin >> k;
    int x=7%k;
    int cnt=1;
    set<int> s;
    while(s.count(x)==0){
        if(x==0){
            cout << cnt ENDL;
            return 0;
        }
        s.insert(x);
        x=(x*10+7)%k;
        cnt++;
    }

    cout << -1 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.
Language: C

#include <stdio.h>
#include <math.h>

int main(void){
  int K, i=1, seven=7;
  
  scanf("%d", &K);
  if(K%2){
    while(seven%K&&i<(int)pow(10,6)){
      seven+=7*(int)pow(10,i++);}
    printf("%d\n", i(int)pow(10,6)?i:-1);
  } else {
    printf("%d\n", -1);}
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:22: error: expected expression before 'int'
   11 |     printf("%d\n", i(int)pow(10,6)?i:-1);
      |                      ^~~
main.c:11:20: error: called object 'i' is not a function or function pointer
   11 |     printf("%d\n", i(int)pow(10,6)?i:-1);
      |                    ^
main.c:5:10: note: declared here
    5 |   int K, i=1, seven=7;
      |          ^
main.c:11:26: error: expected ')' before 'pow'
   11 |     printf("%d\n", i(int)pow(10,6)?i:-1);
      |           ~              ^~~
      |                          )
Language: C

#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

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

    //偶数は排除
    if (k % 2 == 0 || k%5 == 0) {
        cout << -1 << endl;
        return 0;
    }
    /*
    7の倍数か

    k*ある値＝77777...
    
    */
    int count = 0;
    int i = 1;
    long long number = 7;
    while (1) {
        if (number % k == 0) {
            count = i;
            break;
        }
        else {
            number = number * 10 + 7;
            i++;
        }

    }

    cout << count << endl;

    return 0;
}


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

#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;


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

    //偶数は排除
    if (k % 2 == 0 || k%5 == 0) {
        cout << -1 << endl;
        return 0;
    }
    /*
    7の倍数か

    k*ある値＝77777...
    
    */
    int count = 0;
    int i = 1;
    long long number = 7;
    while (1) {
        if (number % k == 0) {
            count = i;
            break;
        }
        else {
            number = number * 10 + 7;
            i++;
        }

    }

    cout << count << endl;

    return 0;
}


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

#include <stdio.h>

int main(void){
  int K, i=1, seven=7;
  
  scanf("%d", &K);
  if(K%2){
    while(seven%K){
      seven+=7*pow(10,i++);}
    printf("%d\n", i);
  } else {
    printf("%d\n", -1);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:16: error: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
    9 |       seven+=7*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 | 
main.c:9:16: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
    9 |       seven+=7*pow(10,i++);}
      |                ^~~
main.c:9:16: note: include '<math.h>' or provide a declaration of 'pow'
main.c:14:1: error: expected declaration or statement at end of input
   14 | }
      | ^
Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <climits>
#include <assert.h>
#include <cstring>
#include <set>
using namespace std;

typedef long long ll;

int main()
{
    int k;
    cin >> k;
    if(k%2 == 0 || k % 5 == 0)
    {
        cout << -1 << "\n";
        return;
    }
    int n = 1;
    int div = 7;
    while(true)
    {
        if(div%k==0)
        {
            cout << n << "\n";
            return;
        }
        n++;
        div = (div%k)*10+7;
    }
    
}

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

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
#define ll long long
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll k;
	cin >> k;
	ll seven = 7;
	int ans = -1;
	if(k%2 != 0) {
		ans = -1;
		for(int i = 1;i<1e7;i++) {
			if(seven == 0) {
				ans = i;
				break;
			}
			seven = (seven*10+7)%k;	
		}
	}
	cout << ans

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

#include<bits/stdc++.h>
using namespace td;
using ll=long long int;
int main()
{
  ll mod,val;
  cin>>mod;
  val=7%mod;
  for(int i=1;i<1e7;i++)
  {
    
    if(val==0)
    {
      cout<<i<<endl;
      break;
    }
    val=(val*10+7)%mod;
  }
  cout<<"-1"<<endl;
}


Compiler output:
a.cc:2:17: error: 'td' is not a namespace-name
    2 | using namespace td;
      |                 ^~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>mod;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:14:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |       cout<<i<<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:14:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |       cout<<i<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   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:19:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   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<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(30);
#define ll long long
#define pi 3.14159265359
using namespace std;

int main()
{
    IOS;
    int k,s=0;
    cin>>k;
    for(int i=0;i<=1000000){
        s=(s*10+7)%n;
        if(!f) return cout<<i,0;
    }
    return cout<<-1,0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: expected ';' before ')' token
   12 |     for(int i=0;i<=1000000){
      |                           ^
      |                           ;
a.cc:13:20: error: 'n' was not declared in this scope
   13 |         s=(s*10+7)%n;
      |                    ^
a.cc:14:13: error: 'f' was not declared in this scope
   14 |         if(!f) return cout<<i,0;
      |             ^
Language: C++

       	       	"
//============================================================================
// Name        : template.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <bits/stdc++.h>
using namespace std;
#define _CRT_SECURE_NO_DEPRECATE // suppress some compilation warning messages (for VC++ users)
// Shortcuts for "common" data types in contests
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;
// To simplify repetitions/loops, Note: define your loop style and stick with it!
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local!
#define forn(i,n) \
for (int i =0; i<(n); i++)
#define TRvi(c, it) \
for (vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for (msi::iterator it = (c).begin(); it != (c).end(); it++)
#define INF 2000000000 // 2 billion
// If you need to recall how to use memset:
#define MEMSET_INF 127 // about 2B
#define MEMSET_HALF_INF 63 // about 1B
//memset(dist, MEMSET_INF, sizeof dist); // useful to initialize shortest path distances
//memset(dp_memo, -1, sizeof dp_memo); // useful to initialize DP memoization table
//memset(arr, 0, sizeof arr); // useful to clear array of integers

int A() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	if (n >= 30) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}

int B() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n, d;
	cin >> n >> d;
	int an = 0;
	while (n--) {
		double x, y; cin >> x >> y;
		double dis = (x * x) + (y * y);
		if (dis <= d * d) {
			an++;
		}
	}
	cout << an << "\n";
	return 0;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int k;
	ll x = 0;
	ll ct = 0;
	ll lmt = 10e7;
	bool fd = false;
	while (ct < lmt) {
		ct++;
		x = (x * 10) + 7;
		x %= k;
		if (x == 0) {
			fd = true;
			cout << ct << "\n";
			break;
		}
	}
	if (!fd) {
		cout << -1 << "\n";
	}
	return 0;
}

int D() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	string s ; cin >> s;
	string org = s;
	int reds = 0;
	forn(i, n) {
		if (s[i] == 'R') reds++;
	}
	int ans = 0;
	forn(i , reds) {
		if (org[i] == 'W') ans++;
	}
	cout << ans << "\n";
	return 0;
}


Compiler output:
a.cc:1:17: warning: missing terminating " character
    1 |                 "
      |                 ^
a.cc:1:17: error: missing terminating " character
Language: C++

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

    using namespace std;
    typedef long long ll;
    typedef unsigned long long ull;
    # define M_PI  3.14159265358979323846


    const int M=1e9+7;
    long long mod(long long x){
        return ((x%M + M)%M);
    }
    long long add(long long a, long long b){
        return mod(mod(a)+mod(b));
    }
    void solve(){
        int k;
        cin>>k;
        int total=0;
        for(int i=1;i<=(1e7);i++){
            r=(r*10+7)%k;
            if(r==0){
                cout<<i;
                return;
        }
            cout<<-1;
    }
    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cout<<fixed;
        cout<<setprecision(10);
//        freopen("timber_input.txt", "r", stdin);
//        freopen("timber_output.txt", "w", stdout);
        int t=1;
//        cin>>t;
        for(int i=1;i<=t;i++){
//            cout<<"Case #"<<i<<": ";
            solve();
        }
        return 0;
    }


Compiler output:
a.cc: In function 'void solve()':
a.cc:22:13: error: 'r' was not declared in this scope
   22 |             r=(r*10+7)%k;
      |             ^
a.cc:29:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   29 |     int main(){
      |             ^~
a.cc:29:13: note: remove parentheses to default-initialize a variable
   29 |     int main(){
      |             ^~
      |             --
a.cc:29:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:29:15: error: a function-definition is not allowed here before '{' token
   29 |     int main(){
      |               ^
a.cc:44:6: error: expected '}' at end of input
   44 |     }
      |      ^
a.cc:17:17: note: to match this '{'
   17 |     void solve(){
      |                 ^
Language: C++

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

int main(){
  int n;
  cin>>n;
  if(n%2==0 || n%5==0){cout<<-1<<endl;}
  else{
   int ones = 1;
    int val = 7;
    while(true){
     
      if(val % n == 0){
        cout<<ones<<endl;
       break; 
      }
      ++ones;
      val = val *10 + 7;
      val = val %k;
    }
    
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'k' was not declared in this scope
   19 |       val = val %k;
      |                  ^
Language: C++

#include <iostream>
int main(){
  int k;
  std::cin >> k;
  int r = 1;
  int tmp = 7;
  if(k % 10 == 0 or k % 10 == 2 or k % 10 == 4 or k % 10 == 5 or k % 10 == 6 or k % 10 == 8)std::cout<<"-1"<<std::endl;
  else{
    while(true){
      if(tmp % k == 0){
        std::cout << r << std::endl;
        break;
      }
      r++;
      tmp = tmp*10+7;
    }
  }
}
#include <iostream>
int main(){
  int k;
  std::cin >> k;
  int r = 0;
  int tmp = 0;
  if(k % 10 == 0 or k % 10 == 2 or k % 10 == 4 or k % 10 == 5 or k % 10 == 6 or k % 10 == 8)std::cout<<"-1"<<std::endl;
  else{
    while(++r){
      tmp = (tmp * 10 + 7) % k;
      if(tmp == 0){
        std::cout << r << std::endl;
        break;
      }
    }
  }
}

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

#inlude<bits/stdc++.h>
using namespace std;
int main(){
	int k;
  	cin>>k;
  	int ind = 1e06;
  	vector<int> nums = {7,77,777,7777,77777,777777,7777777};
  	for(int i=0;i<7;i++){
    	if(nums[i]%k==0) ind = min(ind,i);
    }
  	ind==1e06 ? cout<<-1 : cout<<ind;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>k;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude<bits/stdc++.h>
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> nums = {7,77,777,7777,77777,777777,7777777};
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inlude<bits/stdc++.h>
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> nums = {7,77,777,7777,77777,777777,7777777};
      |                ^~~
a.cc:9:12: error: 'nums' was not declared in this scope
    9 |         if(nums[i]%k==0) ind = min(ind,i);
      |            ^~~~
a.cc:9:32: error: 'min' was not declared in this scope; did you mean 'main'?
    9 |         if(nums[i]%k==0) ind = min(ind,i);
      |                                ^~~
      |                                main
a.cc:11:21: error: 'cout' was not declared in this scope
   11 |         ind==1e06 ? cout<<-1 : cout<<ind;
      |                     ^~~~
a.cc:11:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#inlude<bits/stdc++.h>
using namespace std;
int main(){
	int k;
  	cin>>k;
  	int ind = 1e06;
  	vector<int> nums = {7,77,777,7777,77777,777777,7777777};
  	for(int i=1;i<=7;i++){
    	if(nums[i]%k==0) ind = min(ind,i);
    }
  	ind==1e06 ? cout<<-1 : cout<<ind;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin>>k;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude<bits/stdc++.h>
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> nums = {7,77,777,7777,77777,777777,7777777};
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inlude<bits/stdc++.h>
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> nums = {7,77,777,7777,77777,777777,7777777};
      |                ^~~
a.cc:9:12: error: 'nums' was not declared in this scope
    9 |         if(nums[i]%k==0) ind = min(ind,i);
      |            ^~~~
a.cc:9:32: error: 'min' was not declared in this scope; did you mean 'main'?
    9 |         if(nums[i]%k==0) ind = min(ind,i);
      |                                ^~~
      |                                main
a.cc:11:21: error: 'cout' was not declared in this scope
   11 |         ind==1e06 ? cout<<-1 : cout<<ind;
      |                     ^~~~
a.cc:11:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main()
{
	int k; cin>>k;
	
	int last=0;
	
	for(int i=0;i<100000;i++);
	{
		last=last*10+7;
		if(last%k==0)
		{
			cout<< i+1 <<endl;
			return 0;
		}
	}
	cout<<"-1\n";
	return 0;
}

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

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using vec = vector<int>;
using vec2 = vector<vector<int>>;
ll inf = pow(2,62);

int main(){
    ll k;cin >> k;
    ll o = 0;
    ll count = 0;
    if(k %2 == 0 || k%5 == 0){
        cout << -1 << endl;
    }else{
        while(o % k != 0){
            o = O * 10 +  7;
            count++;
            o = o%k;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'O' was not declared in this scope
   19 |             o = O * 10 +  7;
      |                 ^