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

#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
using namespace std;

typedef long long ll;


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


vector <pair <ll, ll> > prime_factorize (ll N) {
	vector <pair <ll, ll> > res;
	for (ll a = 3; a*a <= N; a+=2) {
		if (N%a != 0)
			continue;
		ll ex = 0;
		while (N%a==0) {
			ex ++;
			N /= a;
		}

		res.push_back ({a, ex});
	}
	if (N != 1)
		res.push_back ({N,1});
	return res;
}


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

	map <ll, ll> mp;
	mp[3] = 3;
	mp[11] = 2;
	mp[13] = 6;
	mp[37] = 3;
	mp[41] = 5;
	mp[101] = 4;
	mp[271] = 5;

	const auto &res = prime_factorize (K);

	vector<ll> ppv;

	for (pair<ll,ll> m: res) {
		ll pw = 0;
		if (mp[m.first] != 0)
			pw = mp[m.first];
		else
			pw = (m.first-1);
		ppv.push (pw*m.second);
	}
	ll ans = ppv[0];
	for (int i=1; i<ppv.size(); i++) {
		ll g = gcd (ppv[i], ans);
		ans *= ppv[i] / g;
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:72:21: error: 'class std::vector<long long int>' has no member named 'push'
   72 |                 ppv.push (pw*m.second);
      |                     ^~~~
Language: C++

#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

const int inf=1000000007;

int a[500005], ma[500005];
struct w
{
    int x, y, k, z, c;
}w[500005];
int N;
bool cmp(struct w a,struct w b)
{
    if(a.z==b.z)
    {
        return a.y<b.y;
    }
    return a.z<b.z;
}
bool cmp1(struct w a,struct w b)
{
    return a.k<b.k;
}
int n, q;

int main()
{
    scanf("%d %d",&n,&q);
    int z=7, ji=0;
    while(ji<=1000000)
    {
        ji++;
        if(z%k==0)
        {
            break;
        }
        z=z*10+7;
    }
    printf("%d\n",ji);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:14: error: 'k' was not declared in this scope
   36 |         if(z%k==0)
      |              ^
Language: C++

#include <bits/stdc++.h>
#include <stdlib.h>
#include <string>
using namespace std;
 
int main() {
  int K,count=1;
  cin >> K;
  if((K%2) == 0){
    cout << "-1" << endl;
    return 0;
  }
  string seven_char = "7";
  while(atoi(seven_char.str())<K){
    seven_char += "7";
    count++;
  }
  for(;;){
	if((atoi(seven_char.c_str())%K) == 0){
      break;
    }
    seven_char += "7";
    count++;
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'str'
   14 |   while(atoi(seven_char.str())<K){
      |                         ^~~
Language: C++

#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair  
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define PI 3.1415926535
using namespace std;


int main() {
  fastio;
 /* freopen("input.txt", "r", stdin);
  freopen("op1.txt", "w", stdout);*/
  ll k,ind=0;
  cin>>k;
  f(i,1,2e6){
    ind=(ind*10+7)%k;
    if(!ind){cout<<i<<endl;return 0;}
  }
  cout<<-1<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'll' was not declared in this scope; did you mean 'all'?
   27 |   ll k,ind=0;
      |   ^~
      |   all
a.cc:28:8: error: 'k' was not declared in this scope
   28 |   cin>>k;
      |        ^
a.cc:29:5: error: expected ';' before 'i'
   29 |   f(i,1,2e6){
      |     ^
a.cc:3:26: note: in definition of macro 'f'
    3 | #define f(i,a,b) for( ll i = a; i < b ; i++ )
      |                          ^
a.cc:29:5: error: 'i' was not declared in this scope
   29 |   f(i,1,2e6){
      |     ^
a.cc:3:33: note: in definition of macro 'f'
    3 | #define f(i,a,b) for( ll i = a; i < b ; i++ )
      |                                 ^
a.cc:30:5: error: 'ind' was not declared in this scope; did you mean 'int'?
   30 |     ind=(ind*10+7)%k;
      |     ^~~
      |     int
Language: C++

#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define ones(x) (ll) __builtin_popcount(x)
#define fs first
#define sc second
#define pb push_back
#define po pop_back
#define mp make_pair  
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ller ios::sync_with_stdio(false);cin.tsie(nullptr);cout.tie(nullptr)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define PI 3.1415926535
using namespace std;


int main() {
  fastio;
  freopen("input.txt", "r", stdin);
  freopen("op1.txt", "w", stdout);
  ll k,ind=0;
  cin>>k;
  f(i,1,2e6){
    ind=(ind*10+7)%k;
    if(!ind){cout<<i<<endl;return 0;}
  }
  cout<<-1<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: 'll' was not declared in this scope; did you mean 'all'?
   27 |   ll k,ind=0;
      |   ^~
      |   all
a.cc:28:8: error: 'k' was not declared in this scope
   28 |   cin>>k;
      |        ^
a.cc:29:5: error: expected ';' before 'i'
   29 |   f(i,1,2e6){
      |     ^
a.cc:3:26: note: in definition of macro 'f'
    3 | #define f(i,a,b) for( ll i = a; i < b ; i++ )
      |                          ^
a.cc:29:5: error: 'i' was not declared in this scope
   29 |   f(i,1,2e6){
      |     ^
a.cc:3:33: note: in definition of macro 'f'
    3 | #define f(i,a,b) for( ll i = a; i < b ; i++ )
      |                                 ^
a.cc:30:5: error: 'ind' was not declared in this scope; did you mean 'int'?
   30 |     ind=(ind*10+7)%k;
      |     ^~~
      |     int
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>k;
      |     ^~~
a.cc:6:24: error: 'cout' was not declared in this scope
    6 |         if(!sum)return cout<<i,0;
      |                        ^~~~
a.cc:8:12: error: 'cout' was not declared in this scope
    8 |     return cout<<-1,0;
      |            ^~~~
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
        int ans = -1;
        int d = 7%a;
        for(int i=0;i<a;i++){if(d==0){ans=i+1;break;}
                            }
		System.out.println(ans);
}


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

#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int k;
	cin >> k;
	if (k % 2 == 0 || k % 5 == 0) {
		print(-1);
		return 0;
	}
	else {
		int n = k - 1;//k-1の約数を調べる
		FOR(i,2, k - 1) {
			if (n%i == 0) {
				int a = 7 * (pow(10, i)-1) / 9;
				if (a% k == 0) {
					print(i);
					return 0;
				}
			}
		}
		print(k - 1);
	}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:10: error: expected '}' at end of input
   53 |         }
      |          ^
a.cc:34:19: note: to match this '{'
   34 | signed main(void) {
      |                   ^
Language: C++

ll calc(ll n)
{
	ll sum = 7, st = 10;
	for(int i = 0; i < 1000000; i++)
	{
		if(sum % n == 0)
			return i + 1;
		sum = sum * 10;
		sum %= n;
		sum += 7;
		sum %= n;
	}
	return -1;
}


Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll calc(ll n)
      | ^~
Language: C++

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

#define DEBUG 0;
 

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

    int counter = -1;

    if(K == 7){
        counter = 1;
        cout << counter << endl;
        return 0;
    }

    int a = 7;


    for(int i = 1; i < K+1; i++){
        if((a % K) == 0){
            #if DEBUG
            cout << (int)((pow(10,i) -1) / 9) << endl;
            #endif
            counter = i+1;
            cout << counter << endl;
            return 0;

        }else{
            a *= 10;
            a += 7;
        }


    }


    cout << counter << endl;

 


  


    return 0;

}




Compiler output:
a.cc:4:16: error: token ";" is not valid in preprocessor expressions
    4 | #define DEBUG 0;
      |                ^
a.cc:24:17: note: in expansion of macro 'DEBUG'
   24 |             #if DEBUG
      |                 ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(void){
  ll k;
  char n="";
  cin>>k;
  for(ll i=0;i<=100000;i++){
    n+="7";
    if(((int)n)%k==0){
      cout<<i<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    6 |   char n="";
      |          ^~
      |          |
      |          const char*
a.cc:9:6: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    9 |     n+="7";
      |     ~^~~~~
      |      |
      |      const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <boost/multiprecision/cpp_int.hpp>

int main(){
  int K, count;
  cin >> K;
  int a = 7;
  while(a%K !=0){
  b= a%K;
  K = b*10 + 7;
   count++;
  }
  cout <<count <<endl; 
  

   
}

Compiler output:
a.cc:4:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    4 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> LP;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

int main(){
	vector<bool> primes(1000100, true);
	primes[0] = false; primes[1] = false;
	for(int i = 2; i < 1000100; ++i){
		if(primes[i] == false)continue;
		for(int j = 2; i*j < 1000100; ++j){
			primes[i*j] = false;
		}
	}	
	int N ;cin >> N;
	int ans = 1;
	int now = 0;
	int add = 7 % N;
	while(ans < 10000000){
		now *= 10;
		now += add;
		now %= N;
		if(now == 0){
			cout << ans << endl;
			return 0;
		}
		++ ans;
	}
	cout << -1 << endl;
	
 	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:16: error: 'cin' was not declared in this scope
   36 |         int N ;cin >> N;
      |                ^~~
a.cc:13:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   12 | #include <algorithm>
  +++ |+#include <iostream>
   13 | using namespace std;
a.cc:45:25: error: 'cout' was not declared in this scope
   45 |                         cout << ans << endl;
      |                         ^~~~
a.cc:45:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:50:9: error: 'cout' was not declared in this scope
   50 |         cout << -1 << endl;
      |         ^~~~
a.cc:50:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <iomanip> //setprecision()
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
using ll = long long;
using namespace std;

double Mcos(double k){return cos(k*atan(1.0)*4/180);}

void monmo(){
    
}

int main() {
    int k;
    cin>>k;
    if(k%2==0){
        cout<<"-1";
        exit(0);
    }
    int s=7;
    int hoji=7;
    for(int i=1;;i++){
        if(s%k==0){
            cout<<i;
            exit(0);
        }
        s%=k;
        hoji=(hoji*10)%k;
        s+=hoji;
    }
    if(i>100000){
        cout<<"-1";
        exit(0);
    }
}


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

#include <bits/stdc++.h>
 
using namespace std;
 
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 
 
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
 
int gcd(int a, int b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}
 
long long lcm (int a, int b){
    return  (long long) a*b /gcd(a,b);
}


int main(){
    int K;

    cin >> K;

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

    long long s = 1;
    for(long long i=1; i*i<=  1000000;i
        +){
        if(s%K == 0){
            cout << i << endl;
            return 0;
        }

        s = s + pow(10,i) ;

    }
    cout << -1<< endl;

}



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

#include<bits/stdc++.h>
using namespace std ;
typedef long long int ll;
#define in(n) ll n;cin>>n;
#define fo(m,n) for(int i=m;i< n;i++)
#define rfo(m,n) for(ll i =n;i>=m;i--)
#define out(n) cout<<n<<endl;
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a<b)?a:b)

int pow(int a,int b)
{
    int z =1;
    for(int i=0;i<b;i++ )
    {
        z*=a;
    }
    return z;
}
int main ()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
   int k;cin>>k;
   if(!(k%7)) k = k/7;
   if(!(k%2)) {cout<<-1;return 0;}
   if(k%10==5){cout<<-1;return 0;}
   int n =0;
   while(1)
   {
       ll i =(pow(10,n)-9);++n;
       if((i==k||i>k)&&i%k==0)
       {cout<<n;break;}
   }
    return 0;

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

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(void){
  ll k;
  string n="";
  cin>>k;
  for(ll i=0;i<=100000;i++){
    n+="7";
    if(((int)n)%k==0){
      cout<<i<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   10 |     if(((int)n)%k==0){
      |         ^~~~~~
Language: C++

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

using namespace std;
const int mod = 1e9 + 7;
const long long INF = 1e18;
#define PI 3.141592653589793
#define REP(i, n) for(int i = 0;i < n;++i)
long long H,W,K,N,D;
long long A=7;
int main()
{
  int count=0;
  cin>>K;
  if(K%2==0||K%5==0){
    cout<<-1;
    return 0;
  }
  for(int i=0;i<17;i++){
    if(A%K==0){
      cout<<i+1;
      return 0;
    } 
    A*=10;
    A+=7;   
  }
  if(999983==k){
  	  cout<<999982;
  return 0;
  }
  cout<<-1;
  return 0;
}





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

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define cool ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 
#define ll long long
#define MAX 1000001
#define mod 1000000007
#define pie 3.14159265358979323846
void solve()
{
	int n;
	cin>>n;
	int num=7,cnt=0,flag=1;
	for(i=0;i<1e8;i++) {
		if(num%n==0) {
			cout<<cnt<<"\n";
			flag=1;
			break;
		}
		num = (num*10+7)%n;
	}
	if(flag==0)
	cout<<-1<<"\n";
}
int main()
{ 
    cool;
    int t;
    //cin>>t;
    t=1;
    while(t--){
    	solve();
	}
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:14:13: error: 'i' was not declared in this scope
   14 |         for(i=0;i<1e8;i++) {
      |             ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>

using namespace std;

int power(long long x,int n){
   long long tmp =1;

   for(int =0;i<n;i++){
      tmp *=x;
   }
   return tmp;

}
int seven(long long y,int n){
   if(n==0){
    return  y=7;
   }
     
   
  
   return  seven(y, n-1)+7*power(10,n);
}


int main (){
   long k;
   cin >> k;
   long long a=7;

   for(int i=0; ;i++){
      if(seven(a,i)%k){
         cout<<i<<endl;
         break;
      }
      else{
         cout<<-1<<endl;
      }

   }


   
   


  
}

Compiler output:
a.cc: In function 'int power(long long int, int)':
a.cc:13:12: error: expected unqualified-id before '=' token
   13 |    for(int =0;i<n;i++){
      |            ^
a.cc:13:11: error: expected ';' before '=' token
   13 |    for(int =0;i<n;i++){
      |           ^~
      |           ;
a.cc:13:12: error: expected primary-expression before '=' token
   13 |    for(int =0;i<n;i++){
      |            ^
a.cc:13:15: error: 'i' was not declared in this scope
   13 |    for(int =0;i<n;i++){
      |               ^
a.cc:13:18: error: expected ')' before ';' token
   13 |    for(int =0;i<n;i++){
      |       ~          ^
      |                  )
a.cc:13:19: error: 'i' was not declared in this scope
   13 |    for(int =0;i<n;i++){
      |                   ^
Language: C++

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

int main() {
  int Z, Y;
  cin>>Z>>Y;
  if(7777777777/Z%2==0){
    
}

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

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

int n, cnt=0;
long long k;
string s;

bool check(long long a)
{
    while(a)
    {
        int rem=a%10;
        if(rem!=7) return false;
        a/=10;
    }
    return true;
}
int co(long long a)
{
    int cnt=0;
    while(a) cnt++, a/=10;
    return cnt;
}
int main()
{
    cin >> k;
    if(k%2==0 or k%5==0){ cout << -1; return 0; }
    for(long long i = 1; i <= 100000000; i++){
        if(check(k*i)){ cout << co(k*i) << endl; return 0; }
    }
    if(k%9)
    cout << k-1;
    else cout k;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: expected ';' before 'k'
   35 |     else cout k;
      |              ^~
      |              ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(void){
  ll k;
  string n=;
  cin>>k;
  for(ll i=0;i<=100000;i++){
    n+="7";
    if(((int)n)%k==0){
      cout<<i<<endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected primary-expression before ';' token
    6 |   string n=;
      |            ^
a.cc:10:9: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   10 |     if(((int)n)%k==0){
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int main(){
  long long k;
  cin >> k;
  if(k % 2 == 0){
    cout << "-1" << endl;
  }
  else{
    long long x = 7;
    long long ans = 0;
    
    while(ans <= 100000000){
      x = x % k;
      ans ++;
      if(x== 0){
        break;
      }
      x *= 10;
      x += 7;
    }
    if(ans >= 100000000){
      cout << "-1" << endl;
    }
    else{a
      cout << ans << endl;
    }
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'a' was not declared in this scope
   27 |     else{a
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std ;
typedef long long int ll;
#define in(n) ll n;cin>>n;
#define fo(m,n) for(int i=m;i< n;i++)
#define rfo(m,n) for(ll i =n;i>=m;i--)
#define out(n) cout<<n<<endl;
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a<b)?a:b)

int pow(int a,int b)
{
    int z =1;
    for(int i=0;i<b;i++ )
    {
        z*=a;
    }
    return z;
}
int main ()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
   int k;cin>>k;
   if(!(k%7)) k = k/7;
   if(!(k%2)) {cout<<-1;return 0;}
   if(k%10==5){cout<<-1;return 0;}
   int n =0;
   while(1)
   {
       ll i =(pow(10,n)-9);++n;
       if(i>=k&&i%k==0)
       {cout<<n;break;}
   }
    return 0;

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

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

int main(void)
{
    long k;
    long x;
    long num;
    long cnt = 0;
    long i = 1;
    long count = 0;
    int flag = 0;
    
    scanf("%ld", &k);
    
    num = k;
    while (num != 0) {
        num =/10;
        cnt++;
    }

    if (k % 2 == 0 || k % 5 == 0) {
        printf("-1");
        return 0;
    }
    while (1) {
        i = cnt;
        x = 7 * ((pow(10, i)-1) / 9);
        if (x % k == 0) {
            flag = 0;
            break;
        }
        i++;
    }
    if (0 == flag) {
        while (0 != x) {
            x = x / 10;
            count++;
        }
        printf("%ld", count);
    }
    else {
        printf("-1");
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:14: error: expected expression before '/' token
   18 |         num =/10;
      |              ^
Language: C++

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


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

#include<iostream>
using namespace std;
int main(){
  int a;
  cin>>a;
  int b = 7;
  int count = 0;
  while(True){
    if(K % 2 == 0){
      cout<<"-1"<<endl;
      break;
    }
    else if(a % K != 0){
      count += 1;
      a += 7 * (10 ** count);
    }
    else{
      count += 1
      cout<<count<<endl;
      break
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'True' was not declared in this scope
    8 |   while(True){
      |         ^~~~
a.cc:9:8: error: 'K' was not declared in this scope
    9 |     if(K % 2 == 0){
      |        ^
a.cc:15:21: error: invalid type argument of unary '*' (have 'int')
   15 |       a += 7 * (10 ** count);
      |                     ^~~~~~~
a.cc:18:17: error: expected ';' before 'cout'
   18 |       count += 1
      |                 ^
      |                 ;
   19 |       cout<<count<<endl;
      |       ~~~~       
a.cc:20:12: error: expected ';' before '}' token
   20 |       break
      |            ^
      |            ;
   21 |     }
      |     ~
Language: C++

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


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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int K = sc.nextInt();
		int A[];
        A=new int[100];
		double B[];
        B=new double[100];
        B[0]=7;
        double d;
        d=1.0;
        for(int i=1;i<100;i++){
            for(int j=0;j<i;j++){
              d=d*10.0;
            }
        	B[i]=B[i-1]+7.0*d;
        }
        for(int i=0;i<100;i++){
        	A[i]=(int)B[i];
        }        
        int C[];
        int ff;
        ff=0;
        C=new int[100];
        for(int i=0;i<100;i++){
        	C[i]=A[i]%K;
            if (C[i]==0){
                ff=1
            	System.out.println(i);
                break;
            }
        }
       if(ff==0){
       System.out.println(-1);
       }
	}
}


Compiler output:
Main.java:30: error: ';' expected
                ff=1
                    ^
1 error
Language: C++

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

int main(){
    ll k;
    cin >> k;
    ll ar[k];
    memset(ar,0,sizeof ar);
    ll x = 0;
    ar[0] = 1;
    for(ll i = 0;i < k;i++){
        x = x*10 + 7;
        if(x%k == 0){
            cout<<i+1<<"\n";
            return 0;
        }
        if(ar[x%k]){
            cout<<-1<<"\n";
            return 0;
        }
        else{
            ar[x%k] = 1;
            x %= k;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
    5 |     ll k;
      |     ^~
a.cc:6:12: error: 'k' was not declared in this scope
    6 |     cin >> k;
      |            ^
a.cc:7:7: error: expected ';' before 'ar'
    7 |     ll ar[k];
      |       ^~~
      |       ;
a.cc:8:12: error: 'ar' was not declared in this scope
    8 |     memset(ar,0,sizeof ar);
      |            ^~
a.cc:9:7: error: expected ';' before 'x'
    9 |     ll x = 0;
      |       ^~
      |       ;
a.cc:11:11: error: expected ';' before 'i'
   11 |     for(ll i = 0;i < k;i++){
      |           ^~
      |           ;
a.cc:11:18: error: 'i' was not declared in this scope
   11 |     for(ll i = 0;i < k;i++){
      |                  ^
a.cc:12:9: error: 'x' was not declared in this scope
   12 |         x = x*10 + 7;
      |         ^
Language: C++

#N, K = map(int,input().split())
#A = list(map(int,input().split()))
K = int(input())

if K % 2 == 0:
    print(-1)
n = 1
r = 7 % K
while r != 0:
    r = (10*r+7) % K
    n += 1
print(n)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #N
    1 | #N, K = map(int,input().split())
      |  ^
a.cc:2:2: error: invalid preprocessing directive #A
    2 | #A = list(map(int,input().split()))
      |  ^
a.cc:3:1: error: 'K' does not name a type
    3 | K = int(input())
      | ^
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")


// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */




int main() {


    ll n; cin >> n;
    ll ans = 1;
    Bint a = 7;
    Bint b = 7;

    if(n%10 == 1 || n%10 == 3 || n%10 == 7 || n%10 == 9 ){
        if(a%n == 0){
            cout << ans;
            return 0;
        }
        b *= 10;
        a += b;
        ans ++;
    }else{
        cout << -1;
    }



    return 0;
}


Compiler output:
a.cc:18:10: fatal error: boost/multiprecision/cpp_dec_float.hpp: No such file or directory
   18 | #include <boost/multiprecision/cpp_dec_float.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  lon long k,i,x;
  cin>>k;
  int flag=0;
  for(i=1;i<8;i++)
  {x=7*((pow(10,i)-1)/9);
      if(k%x==0)
      cout<<i;
      flag=1;



  }if(flag==0)
  cout<<"-1";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'lon' was not declared in this scope; did you mean 'long'?
    7 |   lon long k,i,x;
      |   ^~~
      |   long
a.cc:8:8: error: 'k' was not declared in this scope
    8 |   cin>>k;
      |        ^
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=1;i<8;i++)
      |       ^
a.cc:11:4: error: 'x' was not declared in this scope
   11 |   {x=7*((pow(10,i)-1)/9);
      |    ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using ll=long long;
using namespace std;
int main(){
    int k;
    cin>>k;
    int num=0;
    int ans=-1;
  
    rep(i,10000000){
        num=num+7*pow(10,i);
        
        if(num%k==0){
            ans=i+1;
            break;
        }
    }
    if(ans!=-1)cout<<ans;
    else cout<<ans;

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

#include <bits/stdc++.h>
#include <math.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 s;
 
	cin >> s;
 
	int add = 0;
  	bool ju = true
  if (s%2==0){
  }
  else{
    int judge = 0;
    for (int a = 0; a <= s; ++a){
      judge = judge + 7*pow(10.0, double(a));
      add = add + 1 ;
      
      
      if(judge%s==0){
        cout << add << endl;
        ju = false
      }
    }
    
  }
  if (ju){
    cout << "-1" << endl;
  }
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected ',' or ';' before 'if'
   19 |   if (s%2==0){
      |   ^~
a.cc:21:3: error: 'else' without a previous 'if'
   21 |   else{
      |   ^~~~
a.cc:30:19: error: expected ';' before '}' token
   30 |         ju = false
      |                   ^
      |                   ;
   31 |       }
      |       ~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>

using namespace std;

int power(long long x,int n){
   long long tmp =1;

   for(int i;i<n;i++){
      tmp *=x;
   }
   return tmp;

}
int seven(long long y,int n){
   if(n==0){
      y=7;
   }
     
   
   long long y = seven(y, n-1)+7*power(10,n);
   return y;
}


int main (){
   long k;
   cin >> k;
   long long a=7;

   for(int i; ;i++){
      if(seven(a,i)%k){
         cout<<i<<endl;
         break;
      }
      else{
         cout<<-1<<endl;
      }

   }


   
   


  
}

Compiler output:
a.cc: In function 'int seven(long long int, int)':
a.cc:25:14: error: declaration of 'long long int y' shadows a parameter
   25 |    long long y = seven(y, n-1)+7*power(10,n);
      |              ^
a.cc:19:21: note: 'long long int y' previously declared here
   19 | int seven(long long y,int n){
      |           ~~~~~~~~~~^
Language: C++

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

int main() {
  
  int K, i, Isev;
  cin >> K;
  string sev;
  bool j;
  i = 0;
  j = 0;
  sev = "7";
  
  while (j) {
    Isev = stoi(sev);
    
    i++
    
    if ((Isev % K) == 0) {
      j = 1;
    }
    
    else {
      sev += "7"
    }
    
  }
  
  cout << i << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: expected ';' before 'if'
   17 |     i++
      |        ^
      |        ;
   18 | 
   19 |     if ((Isev % K) == 0) {
      |     ~~  
a.cc:23:5: error: 'else' without a previous 'if'
   23 |     else {
      |     ^~~~
a.cc:24:17: error: expected ';' before '}' token
   24 |       sev += "7"
      |                 ^
      |                 ;
   25 |     }
      |     ~
Language: C

#include<stdio.h>
#include<math.h>
int seven(int p){
	double i;
	int t=0;
	for(i=0;i<p;i++){
		t+=(pow(7.0,i+1));
	}
	return t;
}
int main(void){
	int K,i;
	scanf("%d",&K);
	if((K%=2)==0)
		printf("-1");
	else{
		for(i=1;i<1000000;i++){
			if((seven(i)%=K)==0)
				break;
		}
		printf("%d",i);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:37: error: lvalue required as left operand of assignment
   18 |                         if((seven(i)%=K)==0)
      |                                     ^~
Language: C++

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

int main() {
  
  int K, i, intsev;
  cin >> K;
  string sev;
  bool j;
  i = 0;
  j = 0;
  sev = "7"
  
  while (j) {
    intsev = stoi(sev);
    
    i++
    
    if ((intsev % K) == 0) {
      j = 1;
    }
    
    else {
      sev += "7"
    }
    
  }
  
  cout << i << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before 'while'
   12 |   sev = "7"
      |            ^
      |            ;
   13 | 
   14 |   while (j) {
      |   ~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<cstdio>

using namespace std;

int power(long long x,int n){
   long long tmp =1;

   for(int i;i<n;i++){
      tmp *=x;
   }
   return tmp;

}
int seven(long long y,int n){
   if(n==0){
      y=7;
   }
     
   
   long long y = seven(y, n-1)+7*power(10,n);
   return y;
}


int main (){
   long k;
   cin >> k;
   int y=7;

   for(int i; ;i++){
      if(seven(y,i)%k){
         cout<<i<<endl;
         break;
      }
      else{
         cout<<-1<<endl;
      }

   }


   
   


  
}

Compiler output:
a.cc: In function 'int seven(long long int, int)':
a.cc:25:14: error: declaration of 'long long int y' shadows a parameter
   25 |    long long y = seven(y, n-1)+7*power(10,n);
      |              ^
a.cc:19:21: note: 'long long int y' previously declared here
   19 | int seven(long long y,int n){
      |           ~~~~~~~~~~^
Language: C++

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

int main() {
  
  int n;
  cin >> n;
  long a[n];
  a[0]=7.0;
  

  for(int i=2;i<n;i++){
    a[i-1]=a[i-2]+7*10
      if(n==7){
        cout << 1 <<endl;
        break;
      }
   
      if(a[i-1]%n==0.0){
        cout << i << endl;
        break;
      }
}
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before 'if'
   13 |     a[i-1]=a[i-2]+7*10
      |                       ^
      |                       ;
   14 |       if(n==7){
      |       ~~
Language: C++

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

int main(void){
    ll k;
    cin >> k;
    
    ll ans = -1;
    if(k % 2 == 0)cout << -1 << endl;
    else if(k % 7 == 0)cout << 1 << endl;
    else if(k % 11 == 0)cout << 2 << endl;
    else {
        if(k % 101 == 0 || k % 10 == 0)cout << to_string(k).size() + 1 << endl;
        else {
            if(k % 5 == 0)cout << -1 << endl;
            else if(k == 3)cout << 3;
            else {
                bool check = true;
                for(ll i = 2;i * i <= k;i++){
                    if(k % i == 0)check = false;
                }
                else if(check){
                    cout << k-1;
                } else cout << k;
            }
        }
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'else' without a previous 'if'
   27 |                 else if(check){
      |                 ^~~~
Language: C++

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

int main() {
  
  int n;
  cin >> n;
  long a[n];
  a[0]=7.0;
  

  for(int i=2;i<n;i++){
    a[i-1]=a[i-2]+7*10
      if(n==7){
        cout << 1 <<endl;
        break;
      }
   
      if(a[i-1]%n==0.0){
        cout << i << endl;
        break;
      }
}
  if(for(int j=0;j<n;j++){
    a[j]%n!=0.0}){
    cout << -1 << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before 'if'
   13 |     a[i-1]=a[i-2]+7*10
      |                       ^
      |                       ;
   14 |       if(n==7){
      |       ~~               
a.cc:24:6: error: expected primary-expression before 'for'
   24 |   if(for(int j=0;j<n;j++){
      |      ^~~
a.cc:24:6: error: expected ')' before 'for'
   24 |   if(for(int j=0;j<n;j++){
      |     ~^~~
      |      )
a.cc:24:18: error: 'j' was not declared in this scope
   24 |   if(for(int j=0;j<n;j++){
      |                  ^
a.cc:25:17: error: expected primary-expression before ')' token
   25 |     a[j]%n!=0.0}){
      |                 ^
Language: Java

import java.util.*;

public class Solution
{
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int curr = 7;
        int sum = 0;
        boolean found = false;
        for(int i = 1 ; i <= 1000000 ; i++)
        {
            sum += curr%n;
            sum %= n;
            if(sum == 0)
            {
                found = true;
                System.out.println(i);
                break;
            }
            curr = curr*10%n;
        }
        if(!found)
        System.out.println("-1");
    }
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int K = sc.nextInt();
		int A[];
        A=new int[100];
		double B[];
        B=new double[100];
        B[0]=7;
        double d;
        for(int i=1;i<100;i++){
            for(int j=0;j<i;j++){
              d=d*10;
            }
        	B[i]=B[i-1]+7.0*d;
        }
        for(int i=1;i<100;i++){
        	A[i]=(int)B[i];
        }        
        int C[];
        C=new int[100];
        for(int i=1;i<100;i++){
        	C[i]=A[i]%K;
            if (C[i]=0){
            	System.out.println(i);
            } else {
            	System.out.println(-1);
            }
        }               
	}
}


Compiler output:
Main.java:26: error: incompatible types: int cannot be converted to boolean
            if (C[i]=0){
                    ^
1 error
Language: Java

import java.util.Scanner;
public class _174C {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int[] data = new int[K];
		int calc =0;
		int sum = 7;
		int kari =7;
		
		for(int i=0;i<K;i++) {
			data[i]=sum;
			kari = kari*10;
			sum = kari +sum;
		}
		
		
		for(int i=0;i<K;i++) {
			if(data[i]%K==0) {
				calc=i+1;
				
				break;
			}
		}
		
		if(0<calc) {
			System.out.println(calc);
		}else if(calc==0) {
			System.out.println(-1);
		}
	}

}

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

#include<bits/stdc++.h>
using namespace std;
void main()
{
  int n;
  cin>>n;
  if(n%2==0)
  {
    cout<<"-1";
    exit(0);
  }
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using nampespace std;
void main()
{
  int n;
  cin>>n;
  if(n%2==0)
  {
    cout<<"-1";
    exit(0);
  }
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nampespace'
    2 | using nampespace std;
      |       ^~~~~~~~~~
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   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:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout<<"-1";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define pi (acos(-1))
using namespace std;
/*todos
 * for macro
 * */
std::vector<unsigned ll> genprimevec(const unsigned ll N);
int main()
{
    auto f = [](unsigned ll i) {
        unsigned ll c = 1, r = 1;
        while (r != 0)
        {
            r = (r * 10 + 1) % i;
            ++c;
        }
        return c;
    };

    unsigned ll k;
    cin >> k;
    if (k == 1||i==7)
    {
        cout << 1 << endl;
        return 0;
    }
    auto s = to_string(k);
    bool ffff = true;
    for (auto &cc : s)
    {
        if (cc != '1')
        {
            ffff = false;
            break;
        }
    }

    if (ffff)
    {
        cout << f(k) << endl;
        return 0;
    }

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

    if (k % 7 == 0)
    {
        cout << f(k / 7) << endl;
        return 0;
    }
    /*
    bool bbb = false;
    auto pv = genprimevec(10000000);
    for (auto i : pv)
    {
        if (i == k && i != 5)
        {
            bbb = true;
            break;
        }
    }
    if (!bbb)
    {
        cout << -1 << endl;
        return 0;
    }
*/
    if (k % 5 == 0)
    {
        cout << -1 << endl;
        return 0;
    }
    cout << f(k) << endl;


    return 0;
}

/*author  https://qiita.com/drken/items/0c88a37eec520f82b788*/
ll extgcd(ll a, ll b, ll &x, ll &y)
{
    if (b == 0)
    {
        x = 1, y = 0;
        return a;
    }
    ll d = extgcd(b, a % b, y, x);
    y -= a / b * x;
    return d;
}


std::vector<unsigned ll> genprimevec(const unsigned ll N)
{
    std::vector<bool> is_prime(N + 1);
    for (unsigned ll i = 0; i <= N; i++) { is_prime[i] = true; }
    std::vector<unsigned ll> P;
    for (unsigned ll i = 2; i <= N; i++)
    {
        if (is_prime[i])
        {
            for (unsigned ll j = 2 * i; j <= N; j += i) { is_prime[j] = false; }
            P.emplace_back(i);
        }
    }
    return P;
}

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

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

int main(){
  int k, ans=0, kake, seven=0, i;
  bool flag;
  cin >> k;
  
  for(; flag == 1; i++){
    for(int j=1; j <= 9; j++){
      kake = (pow(10, i) * j + ans) * k; 
      if((kake % pow(10,i+1)) == seven){
        ans += pow(10, i) * j;
        continue;
      }else if(j == 9){
        cout << "-1" << endl;
        flag = 0;
      }
    }
    seven += pow(10, i) * 7;
  }
  if(flag == 1) cout << i << endl; 
}

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

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

char *seven_cur, *seven;
int incrementSeven(int);

int main()
{
    int k, count = 1;
    char *temp;
    scanf("%d", &k);
    if (k % 2 == 0){
        printf("-1");
        return 0;
    }
    
    
    seven_cur = (char *)malloc(sizeof(char));
    seven = (char *)malloc(sizeof(char));
    strcpy(seven, &('7'));
    strcpy(seven_cur, seven);
    
    
    while(1){
        long long sevenL = strtoll(seven_cur, &temp, 10);
        //printf("%lld\n", sevenL);
        if (sevenL % k == 0){
            printf("%d", count);
            break;   
        }
        incrementSeven(++count);
    }
}

int incrementSeven(int length){
    char *buffer = (char *)realloc(seven_cur, length * sizeof(char));
    seven_cur = buffer;
    strcat(seven_cur, seven);
    //printf("%s\n", seven_cur);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:19: error: lvalue required as unary '&' operand
   21 |     strcpy(seven, &('7'));
      |                   ^
Language: C++

#include<bits/stdc++.h>
using nampespace std;
int main()
{
  int n;
  cin>>n;
  if(n%2==1)
  {
    cout<<"-1";
    return 0;
  }
  return 1;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nampespace'
    2 | using nampespace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   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:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |     cout<<"-1";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
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 k;
    cin>>k;
    if(k%2==0){
        cout<<"-1"<<endl;
        return 0;
    }
    else{
        int p=0;
        int i=1;
        while(true){
            int j=i;
            while(i--){
                p=p+7*pow(10,i);
            }
            if(p%n==0){
                cout<<j<<endl;
                break;
            }
            else{
                i=j+1;
                p=0;
                continue;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: error: 'n' was not declared in this scope
   69 |             if(p%n==0){
      |                  ^