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

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

int main()
{
    ll n, d;
    cin >> n >> d;

    vector<ll> x(n), y(n);
    rep (i, n)
        cin >> x[i] >> y[i];

    int ans = 0;
    rep (i, n)
    {
        ll temp = x[i] * x[i] + y[i] * y[i];
        if (temp <= d * d)
            ans++;
    }

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


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

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

using namespace std;
typedef long long ll;

int main(){
    ll n, d;
    cin >> n >>d;

    ll ans = 0;

    vector<ll>x(n, 0);
    vector<llrint>y(n, 0);
    REP(i, n) {
        cin >> x[i] >> y[i];
        if (sqrt((x[i]*x[i])+(y[i]*y[i])) <= d) ans++;
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   18 |     vector<llrint>y(n, 0);
      |                  ^
a.cc:18:18: note:   expected a type, got 'std::llrint'
a.cc:18:18: error: template argument 2 is invalid
a.cc:18:25: error: expression list treated as compound expression in initializer [-fpermissive]
   18 |     vector<llrint>y(n, 0);
      |                         ^
a.cc:20:25: error: invalid types 'int[int]' for array subscript
   20 |         cin >> x[i] >> y[i];
      |                         ^
a.cc:21:32: error: invalid types 'int[int]' for array subscript
   21 |         if (sqrt((x[i]*x[i])+(y[i]*y[i])) <= d) ans++;
      |                                ^
a.cc:21:37: error: invalid types 'int[int]' for array subscript
   21 |         if (sqrt((x[i]*x[i])+(y[i]*y[i])) <= d) ans++;
      |                                     ^
Language: C++

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

int main(){
  int n,d;
  cin>>n>>d;
  int count=0;
  long long x1,y1,dist;
  for(int i=0;i<n;i++){
    int x,y;
    cin>>x>>y;
    x1=x*x;
    y1=y*y;
    if(sqrt(x1+y1)<=d))
       count++;
  }
  cout<<count<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected primary-expression before ')' token
   14 |     if(sqrt(x1+y1)<=d))
      |                       ^
Language: C++

#include<bits/sdtc++.h>
using namespace std;
int main(){
  long long n, d;
  cin >> n >> d;
  int ans = 0;
  for(int i = 0; i < n; i++){
    long long x, y;
    cin >> x >> y;
    long long dist = sqrt(x * x + y * y);
    if(dist <= d){
      ans++;
    }
  }
  cout <<ans;
}

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

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

int main() {
    ll x,n,d,y;
    cin>>n>>d;
    ll cnt=0;
    while(n--){
        cin>>x>>y;
        if(x*x+y*y<=D*D) cnt++;
    }
    cout<<cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'D' was not declared in this scope
   11 |         if(x*x+y*y<=D*D) cnt++;
      |                     ^
Language: C


/*
	*	Created By: 'Present_Sir'
	*	Created On: Sunday 02 August 2020 05:32:48 PM IST
*/

#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)
#define int long long
using namespace std;


void solve(){
    int n,d;
    cin>>n>>d;
    int ans=0;
    for(int i=0; i<n; i++){
        int x,y;
        cin>>x>>y;
        if(sqrt(x*x+y*y) <= d){
            ans++;
        }
    }
    cout<<ans<<endl;
}

int32_t main(){
    IOS;
    //int t; cin>>t; while(t--)
    {
        solve();
    }
    return 0;
}



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

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

 using namespace std;
 int main()
 {
     int t;
     cin>>t;
     while(t--)
     {
         long long a,b,sum=0;
         cin>>a>>b;
         sum=sqrt(a*a+b*b);
         long long k=0;
         k=max(k,sum);
     }
     cout<<k;
 }


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

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

int main(){
  int n,d,cnt=0;
  cin >> n >> d;
  int x,y;
  double z;
  for(int i=0;i<n;i++){
    cin >> x >> y;
    z.at(i) = x*x * y*y;
    if(z <= d*d) cnt++;
  }
  
  cout << cnt << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: request for member 'at' in 'z', which is of non-class type 'double'
   12 |     z.at(i) = x*x * y*y;
      |       ^~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef double db; //
typedef string str; //
//
typedef pair<int,int> pi;
typedef pair<ll,ll> pl; //
typedef pair<db,db> pd; //
//
typedef vector<int> vi; 
typedef vector<ll> vl; //
typedef vector<db> vd; //
typedef vector<str> vs; //
typedef vector<pi> vpi;
typedef vector<pl> vpl; //
typedef vector<pd> vpd; //
 
typedef tree<pi, null_type, less<pi>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
 
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend() //
#define rsz resize
#define ins insert //
#define ft front() //
#define bk back()
#define pf push_front //
#define pb push_back
#define eb emplace_back //
#define lb lower_bound //
#define ub upper_bound //
 
#define for(i,a,b) for (int i = (a); i < (b); ++i)
#define f0r(i,a) for(i,0,a)
#define rof(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define r0f(i,a) rof(i,0,a)
#define trav(a,x) for (auto& a: x)
 
const int mod = 1e9+7; // 998244353;
const int mx = 2e5+5; //
const ll inf = 1e18; //
const ld pi = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1}; //
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count()); //
//
template<class t> bool ckmin(t& a, const t& b) { 
	return b < a ? a = b, 1 : 0; }
template<class t> bool ckmax(t& a, const t& b) { //
	return a < b ? a = b, 1 : 0; } //
constexpr int pct(int x) { return __builtin_popcount(x); } //
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x)) //
constexpr int cdiv(int a, int b) { return a/b+!(a<0||a%b == 0); } // division of a by b rounded up, assumes b > 0 //
// ignore
int fsttrue(function<bool(int)> f, int lo, int hi) {
	hi ++; assert(lo <= hi); // assuming f is increasing
	while (lo < hi) { // find first index such that f is true 
		int mid = (lo+hi)/2; 
		f(mid) ? hi = mid : lo = mid+1; 
	} 
	return lo;
}
template<class t> void remdup(vector<t>& v) { 
	sort(all(v)); v.erase(unique(all(v)),end(v)); }
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t fixed_random = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + fixed_random);
    }
};
// ignore
//
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, d;
	cin >> n >> d;
	int cnt = 0;
	f0r(a, n){
		ll x, y;
		cin >> x >> y;
		if(d * d >= x * x + y * y)
			cnt++;
	}
	cout << cnt << endl;
}


Compiler output:
a.cc:50:10: error: 'const ld pi' redeclared as different kind of entity
   50 | const ld pi = acos((ld)-1);
      |          ^~
a.cc:11:23: note: previous declaration 'typedef struct std::pair<int, int> pi'
   11 | typedef pair<int,int> pi;
      |                       ^~
Language: C++

#pragma GCC optimize("Ofast")


#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<limits.h>
#include<cmath>
#include<queue>
#include<stack>

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

#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
#define chmax(a,b) {if(a < b) a = b;}
#define chmin(a,b) {if(a > b) a = b;}

using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);

	//Program Start	
	ll N, D;
	cin >> N >> D;

	int ans = 0;

	rep(i, N) {
		ll X, Y;
		cin >> X >> Y;
		if(X * X + Y * Y + Y *Y <= D * D)
			ans ++;
	}

	cout << ans << endl;

	if(30 <= x) {
		cout << "Yes" << endl;
	} else {
		cout << "No" <<endl;
	}

EndPoint:;

	//Program End
#ifndef DEBUG
	system("read -p 'Press enter'");
#endif // !DEBUG

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:48:18: error: 'x' was not declared in this scope
   48 |         if(30 <= x) {
      |                  ^
Language: C++

#include<bits/stdc++.h>
#define pir pair<int,int>
#define qmin(x,y) (x=min(x,y))
#define qmax(x,y) (x=max(x,y))
#define rsort(x,y) sort(x,y),reverse(x,y)
#define fr first
#define se second
using namespace std;
typedef long long ll;
const int Maxn=2100000;
const int inf=0x3f3f3f3f;

int n,d,ans,x,y

signed main() {
    // freopen("test.in","r",stdin);
    scanf("%d%d",&n,&d);
    ll sxz=d*d;
    for(int i=1;i<=n;i++) {
        scanf("%d%d",&x,&y);
        if(1ll*x*x+1ll*y*y<=sxz) ans++;
    }
    printf("%d\n",ans);
    return 0;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (ll i=0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;

int main(){
    ll n,d; cin >> n >> d;
    int ans=0;
    rep(i,n){
        ll x,y;
        cin >> x >> y;
        if(x*x+y*y<=d*d) ans++;        
    }
    cout << ans << endl;
}#include <bits/stdc++.h>
#define rep(i,n) for (ll i=0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;

int main(){
    ll n,d; cin >> n >> d;
    int ans=0;
    rep(i,n){
        ll x,y;
        cin >> x >> y;
        if(x*x+y*y<=d*d) ans++;        
    }
    cout << ans << endl;
}

Compiler output:
a.cc:18:2: error: stray '#' in program
   18 | }#include <bits/stdc++.h>
      |  ^
a.cc:18:3: error: 'include' does not name a type
   18 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:21:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   21 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:4:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
    4 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:22:31: error: redefinition of 'template<class T> bool change(T&, T)'
   22 | template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
      |                               ^~~~~~
a.cc:5:31: note: 'template<class T> bool change(T&, T)' previously declared here
    5 | template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
      |                               ^~~~~~
a.cc:26:5: error: redefinition of 'int main()'
   26 | int main(){
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main(){
      |     ^~~~
Language: C++

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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .
/// Start using lower bound !!

void solve ( int test_case )
{
    int n ;
    cin >> n ;

    ll d ;
    cin >> d ;

    int ans = 0 ;
    d *= d ;

    for ( int i=0 ; i < n ; i ++ )
    {
        ll x , y ;
        cin >> x >> y ;

        if ( x*x + y*y <= d )
            ans ++ ;
    }

    cout << ans ; line ; s
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i = 1 ; i <= t ; i ++ )
    {
        solve ( i ) ;
    }

    return 0;
}


Compiler output:
a.cc: In function 'void solve(int)':
a.cc:97:26: error: 's' was not declared in this scope
   97 |     cout << ans ; line ; s
      |                          ^
Language: C++

#import<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long LL;
LL i,j,k,m,n,s,x,y,a[200040];
string s;
main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>m;
	for(;n--;)
	{
		cin>>x>>y;
		if(x*x+y*y<=m*m)s++;
	}
	cout<<s;
}

Compiler output:
a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<bits/stdc++.h>
      |  ^~~~~~
a.cc:6:8: error: conflicting declaration 'std::string s'
    6 | string s;
      |        ^
a.cc:5:14: note: previous declaration as 'LL s'
    5 | LL i,j,k,m,n,s,x,y,a[200040];
      |              ^
a.cc:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#define maxn 1e7+7
using namespace std;
int main()
{
    int k,;long long num=0,sum=0;
    cin>>k;
    bool flag=0;
    for(int i=0;i<maxn;i++)
    {
        num=(num*10+7)%k;
        if(num%k==0)
        {
            flag=1;
            sum=i+1;
            break;
        }
    }
    if(flag==1)
    {
        cout<<sum<<endl;
    }
    else
        cout<<"-1"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected unqualified-id before ';' token
    8 |     int k,;long long num=0,sum=0;
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

using namespace atcoder;
using namespace std;


int main(void){
  ll k;
  cin >> k;
  
  if (k % 7 == 0)
    k /= 7;

  if (k % 9 == 0){
    k /= 9;
    ll t = 1;
    int ok = 0;
    for (ll i = 1; i <= k; i++){
      t = t * pow_mod(10, 9, k) % k;
      if ((t - 1 + k) % k == 0){
        cout << i << endl;
        ok = 1;
        break;
      }
    }
    if (!ok)
      cout << -1 << endl;
  }
  else if (k % 3 == 0){
    k /= 3;
    ll t = 1;
    int ok = 0;
    for (ll i = 1; i <= k; i++){
      t = t * pow_mod(10, 3, k) % k;
      if ((t - 1 + k) % k == 0){
        cout << i << endl;
        ok = 1;
        break;
      }
    }
    if (!ok)
      cout << -1 << endl;
  }
  else {
    ll t = 1;
    int ok = 0;
    for (ll i = 1; i <= k; i++){
      t = t * 10 % k;
      if ((t - 1 + k) % k == 0){
        cout << i << endl;
        ok = 1;
        break;
      }
    }
    if (!ok)
      cout << -1 << endl;
 
  }

  return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>

#define MAXN 1000007
using namespace std;
bool vis[MAXN];

int main()
{
    int ans=-1;
    int now=7;
    int k;
    cin>>k;
    vis[now%k]=1;
    memset(vis,0,sizeof vis);
    if(now%k==0) {
        cout << "1\n";
    } else {
        int i=2;
        while(now) {
            now=(now*10+7)%k;
            if(vis[now]) break;
            else if(now==0) {ans=i; break;}
            i++;
            vis[now]=1;
        }
        cout << ans << '\n';
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'memset' was not declared in this scope
   14 |     memset(vis,0,sizeof vis);
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define rep(i,s,e) for (int64_t i=s; i<e; i++)
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int K, P=0;
  cin >> K;
  vector<int> A(K);
  A[0]=7;
  if (K==1) {
    cout << 1 << endl;
  }
  else {
    rep(i,1,K) {
      A[i]=10*A[i-1]+7;
      A[i]%=K;
    }
    rep(i,0,K) {
      if (A[i]==0) {
        cout << i+1 << endl;
        break;
      }
      else {
        P++;
      }
    }
    if (P==K) {
      cout << -1 << endl;
    }
  }

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

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define rep(i,s,e) for (int64_t i=s; i<e; i++)
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int K, P=0;
  cin >> K;
  vector<int> A(K);
  A[0]=7;
  if (K>1) {
    rep(i,1,K) {
      A[i]=10*A[i-1]+7;
      A[i]%=K;
    }
  }
  rep(i,0,K) {
    if (A[i]==0) {
      cout << i+1 << endl;
      break;
    }
    else {
      P++;
    }
  }
  if (P==K) {
    cout << -1 << endl;
  }

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

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define rep(i,s,e) for (int64_t i=s; i<e; i++)
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int K;
  cin >> K;
  vector<int> A(K);
  A[0]=7;
  if (K>1) {
    rep(i,1,K) {
      A[i]=10*A[i-1]+7;
      A[i]%=K;
    }
  }
  rep(i,0,K) {
    if (A[i]==0) {
      cout << i+1 << endl;
      break;
    }
  }

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

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

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

    return 0;
}

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

#include <bits/stdc++.h>

using namespace std;
 
//#define int long long
using ll = long long;
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,n) for(ll i=0;i<=n;i++)

ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
 
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    ios_base::sync_with_stdio(false);
    ll k;
    cin >> k;
    vector<ll> a(k,0);
    a[1]=7;
    for(int i=1;i<k;i++){
        if(i!=1){
            a[i]=(10*a[i-1]+7);
            a[i]%=k
        }
        if(a[i]%k==0){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: expected ';' before '}' token
   28 |             a[i]%=k
      |                    ^
      |                    ;
   29 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;
 
//#define int long long
using ll = long long;
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,n) for(ll i=0;i<=n;i++)

ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
 
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    ios_base::sync_with_stdio(false);
    ll k;
    cin >> k;
    vector<ll> a(k,0);
    a[1]=7
    for(int i=1;i<k;i++){
        if(i!=1){
            a[i]=10*a[i-1]+7;
        }
        if(a[i]%k==0){
            cout << i << endl;
            break;
        }
    }
    cout << -1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:11: error: expected ';' before 'for'
   24 |     a[1]=7
      |           ^
      |           ;
   25 |     for(int i=1;i<k;i++){
      |     ~~~    
a.cc:25:17: error: 'i' was not declared in this scope
   25 |     for(int i=1;i<k;i++){
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
 
//#define int long long
using ll = long long;
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,n) for(ll i=0;i<=n;i++)

ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
 
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(){
    ios_base::sync_with_stdio(false);
    ll k;
    cin >> k;
    vector<ll> a(N,7);
    for(int i=1;i<1000000;i++){
        if(i!=1){
            a[i]=10*a[i-1]+7;
        }
        if(a[i]%k==0){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: 'N' was not declared in this scope
   23 |     vector<ll> a(N,7);
      |                  ^
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include <stdlib.h>
int main()
{
	int i, x = 7, K;
	scanf("%d", &K);
	if (K % 2 == 0 || K % 5 == 0) {
		printf("-1");
		exit(0);
	}
    if(K == 1){
      print("%d",7);
      exit(0);
    }
	for (i = 0; i < 1000000; i++) {
		x = (x * 10 + 7) % K;
		if (x == 0) {
			printf("%d", i+2);
			exit(0);
		}
	}
	printf("-1");
}

Compiler output:
main.c: In function 'main':
main.c:13:7: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |       print("%d",7);
      |       ^~~~~
      |       printf
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: 'cin' was not declared in this scope
    5 |      cin >> K;
      |      ^~~
a.cc:12:14: error: 'cout' was not declared in this scope
   12 |              cout << i << endl;
      |              ^~~~
a.cc:12:27: error: 'endl' was not declared in this scope
   12 |              cout << i << endl;
      |                           ^~~~
a.cc:16:6: error: 'cout' was not declared in this scope
   16 |      cout << -1 << endl;
      |      ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |      cout << -1 << endl;
      |                    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:6: error: 'LL' was not declared in this scope
    4 |      LL K;
      |      ^~
a.cc:5:6: error: 'cin' was not declared in this scope
    5 |      cin >> K;
      |      ^~~
a.cc:5:13: error: 'K' was not declared in this scope
    5 |      cin >> K;
      |             ^
a.cc:7:8: error: expected ';' before 'x'
    7 |      LL x = 0;
      |        ^~
      |        ;
a.cc:10:10: error: 'x' was not declared in this scope
   10 |          x = (x * 10 + 7) % K;
      |          ^
a.cc:12:14: error: 'cout' was not declared in this scope
   12 |              cout << i << endl;
      |              ^~~~
a.cc:12:27: error: 'endl' was not declared in this scope
   12 |              cout << i << endl;
      |                           ^~~~
a.cc:16:6: error: 'cout' was not declared in this scope
   16 |      cout << -1 << endl;
      |      ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope
   16 |      cout << -1 << endl;
      |                    ^~~~
Language: C++

/*
Written By mafailure
*/
//In the name of God
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less
using namespace std;
using namespace __gnu_pbds;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#define int long long 
//#define int long long 
// int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1};
// int dx[]={2,2,-2,-2,1,1,-1,-1}; int dy[]={1,-1,1,-1,2,-2,2,-2};
const long long mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef vector< pair< int, int > > vii;
typedef map<int, int> mii;
typedef pair<int, ii> pip;
typedef pair<ii, int> ppi;
#define arrinp(arr,init,final,size,type) type* arr=new type[size];for(int i=init;i<final;i++)cin>>arr[i];
#define cr2d(arr,n,m,t) t**arr=new t*[n];for(int i=0;i<n;i++)arr[i]=new t[m];
#define w(t) int t;cin>>t; while(t--)
#define takeInp(n) int n;cin>>n;
#define fr(i,init,final) for(int i=init;i<final;i++)
#define frr(i,init,final) for(int i=init;i>=final;i--)
#define Fr(i,final) for(int i=0;i<final;i++)
#define Frr(i,first) for(int i=first;i>=0;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define debug(x) cerr<<">value ("<<#x<<") : "<<x<<endl;
#define setb __builtin_popcount
#define lsone(n) (n&(-n))
#define rlsone(n) (n&(n-1))
#define clr(a,b) memset(a,b,sizeof(a))
const int inf= INT_MAX;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>  ordered_set; 
vi init(string s)
{
	istringstream sin(s);
	int n;
	vi arr;
	while(sin>>n)arr.push_back(n);
	return arr;
}
int power(int x, int y,int mod)
{ 
	if(y==0)return 1;
	int u=power(x,y/2,mod);
	u=(u*u)%mod;
	if(y%2)u=(x*u)%mod;
	return u;
    
}
int gcd(int a,int b)
{
	if(a<b)return gcd(b,a);
	return (b==0?a:(a%b?gcd(b,a%b):b));
}
int gcd_e(int a,int b,int &x,int &y)
{
	
	if(b==0){x=1; y=0; return a;}
	int x1,y1;
	int p=gcd_e(b,a%b,x1,y1);
	x=y1;
	y=x1-(a/b)*y1;
	return p;
}
signed main()
{
	IOS
	int k;
	cin>>k;
	if(k%2==0||k%5==0){cout<<-1<<endl; return 0;}
	int num=0;
	int ans=0;
	fr(i,0,k)
	{
		num=num*10+7;
		num%=k;
		ans++;
		if(num%k==0){cout<<ans; return 0;}	
	}
	cout<<-1<<endl;
	
	while(rem){rem=(rem*10+1)%k;one++; }
	cout<<one<<endl;
		
	
}



Compiler output:
a.cc: In function 'int main()':
a.cc:98:15: error: 'rem' was not declared in this scope; did you mean 'drem'?
   98 |         while(rem){rem=(rem*10+1)%k;one++; }
      |               ^~~
      |               drem
a.cc:98:37: error: 'one' was not declared in this scope
   98 |         while(rem){rem=(rem*10+1)%k;one++; }
      |                                     ^~~
a.cc:99:15: error: 'one' was not declared in this scope
   99 |         cout<<one<<endl;
      |               ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
	ll k,s,i;
cin>>k;
s=7;
for(i=1;i<=k;i++)
{
	if(s%k==0)
	{
		cout<<i<<endl;
		return;
	}
	s=(s*10+7)%k;12
}
cout<<-1<<endl;return; 


}






int main()
{
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif

	int t=1;
	//cin >> t;

	while (t--)
	{
		solve();
	}


	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:16:24: error: expected ';' before '}' token
   16 |         s=(s*10+7)%k;12
      |                        ^
      |                        ;
   17 | }
      | ~
Language: Java

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
        int res = １;
        long seven = 7; 
        if(K%2==0){
            System.out.println("-1");
            return;
        }else{
            while(seven!=0){
                res++;
                seven = (seven*10+7)%K;
            }
            System.out.println(res);

        }
		
	}
}

Compiler output:
Main.java:6: error: illegal non-ASCII digit
        int res = ?;
                  ^
1 error
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  
    // cinを高速にするためのおまじない
    cin.tie(0);
    ios::sync_with_stdio(false);

    /////////////////////
    // Write code below /
    long long int K,L=0;
    int a = -1;
    // cin >> K;
    if(K%2 == 0){
        a = -1;
    }
    else{
        for(int i = 0; i<=K;i++){
            L = L*10+7;
            if(L%K == 0){
                a = i+1;
                break;
            }
        }
    }
    cout << a << endl;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:46: error: 'K' was not declared in this scope
   14 |                         value=((value*10)+7)%K;
      |                                              ^
Language: C++

#include "/Users/header/stdc++.h"
using namespace std;
int main(){
	long long int N;
  	cin >> N;
  	vector<int> vec;
    int value=7%N;
  	int count =1;
  	while(find(vec.begin(),vec.end(),value) == vec.end()){
	    if(value==0){
        	cout << count << endl;
       		return 0;
        }
        vec.push_back(value);
    	value = (value*10 + 7)%N;
	    count +=1;
    }
  cout << "-1" << endl;
  return 0;
}
  

Compiler output:
a.cc:1:10: fatal error: /Users/header/stdc++.h: No such file or directory
    1 | #include "/Users/header/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int N;
  	cin >> N;
  	vector<int> vec;
  	int value=7%N;
  	if(value ==0 ){
	    cout << 1 << endl;
    	return 0;
    }
  	int count =1;
	vec.push_back(value);
  	while(find(vec.begin(),vec.end(),value) == vec.end()){
    	int value = (value*10 + 7)%N;
	    count +=1;
	    if(value==0){
        	cout << count << endl;
       		return 0;
        }
      	vec.push(value);
    }
  cout << "-1" << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'class std::vector<int>' has no member named 'push'
   21 |         vec.push(value);
      |             ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int inf{int(1e9)};
int main(void){
  int K;
  cin >> K;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'a' was not declared in this scope
   12 |   a[1] = 7 % K;
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int k;
   cin>>k;
   int sum = 0;
   for (int i = 1; i <= 2000006; i++) 
   {
        sum = (sum * 10 + 7) % k;
        if (sum == 0)
        {
            cout << i << '\n';
            return;
        }
    }
    cout << -1 << '\n';
}  

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

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

int main() {
    int k;
    cin>>k;
    int rem=7%k;
    int ans=1;
    if(k%2==0||k%5==0)
        return -1;
    else while(rem){
        freq++;
        rem=(10*7+rem)%k;
    }
    std::cout <<freq<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'freq' was not declared in this scope; did you mean 'free'?
   13 |         freq++;
      |         ^~~~
      |         free
a.cc:16:17: error: 'freq' was not declared in this scope; did you mean 'free'?
   16 |     std::cout <<freq<<endl;
      |                 ^~~~
      |                 free
Language: C


#include<stdio.h>
#include<stdlib.h>
int main()
{
	int i,K,p = -1,ans;
	int b[99999];
	b[0] = 0;
	scanf_s("%d", &K);
	for (i = 1; i < 99999; i++) {
		b[i] = 10 * b[i - 1] + 7;
	}
	for (i = 1; i < 99999; i++) {
		if (b[i] % K == 0) {
			p = 1;
			ans = i;
		}
	}
	if (p == -1) {
		printf("%d", p);
	}
	else {
		printf("%d", ans);
	}
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |         scanf_s("%d", &K);
      |         ^~~~~~~
      |         scanf
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected primary-expression before '=' token
    7 |   t % = n;
      |       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected primary-expression before '=' token
    7 |   t % = k;
      |       ^
a.cc:7:9: error: 'k' was not declared in this scope
    7 |   t % = k;
      |         ^
Language: C++

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



int main() {
	
	
	int n; cin >> n;
	int num = 7;
	
	
	rep(i,INT_MAX){
		if(num > n) num %= n;
		if(num == 0) cout << i << endl;
		else num = num * 10 + 7;
	}
	
	cout << ans << endl;
	
	return 0;
}


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

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

int main()
{
  int n;
  cin >> n;
  if(n&1)
  {
    int sev = 7;
	int cnt = 0;
    for(int i = 1; i <= 10000000; i++)
    {
      cnt++;
      if(sev%n==0)
      {
        return cnt;
      }
      else
      {
       sev=sev*10 + 7; 
      }
    }
  return -1;
}


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

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

int main()
{
  int n;
  cin >> n;
  if(n&1)
  {
    int sev = 7;
    for(int i = 1; i <= 10e8; i++)
    {
      if(sev%n==0)
      {
        cout<<sev;
        break;
      }
      else
      {
       sev=sev*10 + 7; 
      }
    }
  return 0;
}


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

#include <iostream>
#include <string>
using namespace std;
int main(){
    int n;
cin>>n;
p=7;
for (int i = 0; i < 6; i++)
{
    /* code */
if (p%n==0)
{cout<<strlen(to_string(p))
break;}
else{
    p=p*10+7
if( i==5)
{
    cout<<-1;
}
}
 
}
 
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'p' was not declared in this scope
    7 | p=7;
      | ^
a.cc:12:8: error: 'strlen' was not declared in this scope
   12 | {cout<<strlen(to_string(p))
      |        ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: Java

import java.util.Scanner;

//解説を参考
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();

		int[] a = new int[1000001];
		a[1] = 7 % k; //初項

		if (k % 2 != 0) {
			for (int i = 2; i <= k; i++)
				a[i] = (10 * a[i - 1] + 7) % k;

			for (int i = 1; i <= k; i++) {
				if (a[i] == 0) {
					System.out.println(i);
					break;
				}
			}
          	System.out.println(-1)
		} else
			System.out.println(-1);
	}

}


Compiler output:
Main.java:23: error: ';' expected
          	System.out.println(-1)
          	                      ^
1 error
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<map>  
#include<set>
#include<iterator>
#include<list>
#include<utility>
#include<cstdlib>
#include<queue>
#include<stack>
#include<bitset>
//#include<bits/stdc++.h>
#define PI  2*acos(0.0)
#define pb push_back

       
using namespace std;
using ll = long long;
using lli = long long int;
using ld = long double;



int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);

ll n;

cin>>n;

if(n%2==0 || k%5==0) cout<<"-1"<<endl;
else
{
	ll ans=0;
	for(int i=1;i<=n;i++)
	{
	
		ans=(10*ans+7);
		if(ans%n==0)
		{
			cout<<i<<"\n";
			break;
		}
	}
}
		


	
	
	return 0;
	
	
	       /***Israil Hosen
	            Computer Science & Engineering
	         University Of Rajshahi.
	         ***/
	
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: 'k' was not declared in this scope
   38 | if(n%2==0 || k%5==0) cout<<"-1"<<endl;
      |              ^
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
#include <iterator>
typedef long long int ll;
typedef long double ld;
using namespace std;
typedef pair<int,int> pii;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int MAXN = 2e5+50;
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define f first
#define s second
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
ll pow(ll x, ll y, ll mod)
{
	int ans=1;
	while(y)
	{
		if(y&1)
			ans=(ans*x)%mod;
		y/=2;
		x=(x*x)%mod;
	}
	return ans;
}

void solve(){
    ll k,a=7,flag;
    cin>>k;
    if(k%2==0)
       flag=0;
    for(int i=1;i<INT_MAX;++i){
      if(a%k==0){
         flag=1;
         break;
      }
      a=7+(7*pow(10,i));
    }
    if(flag==1)
       cout<<a/k<<endl;
    else
      cout<<-1<<endl;      
}
int main(){
 
   ios::sync_with_stdio(false);
  cin.tie(0);
     solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:57:19: error: 'INT_MAX' was not declared in this scope
   57 |     for(int i=1;i<INT_MAX;++i){
      |                   ^~~~~~~
a.cc:22:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   21 | #include <bitset>
  +++ |+#include <climits>
   22 | #include <iterator>
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#define vi vector<int>
#define lli long long int
#define fo(i,n) for(int i=1;i<=n;i++)
#define foo(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pb push_back
#define vii vector<lli>

#define ok ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#define vp vector<pair<lli,lli>>
#include <map>           
lli mod=1000000007;      

//vi r(300003),c(300003);   
vi v(1000009);

int main(){
   lli k;
   cin>>k;
   a[0]=7%k;
   fo(i,k){
   	a[i]=(a[i-1]*10+7)%k;
   }
   
   foo(i,k){
   	if(a[i]==0){
   		cout<<i+1;
   		return 0;
	   }
   }
   cout<<"-1";
}




Compiler output:
a.cc: In function 'int main()':
a.cc:25:4: error: 'a' was not declared in this scope
   25 |    a[0]=7%k;
      |    ^
Language: C++

#include <bits/stdc++.h> using namespace std; #define ll long long ll check(ll n) { ll ret = 0; while(n) { if(n % 10 != 7) return 0; n /= 10; ret++; } return ret; } int main() { ll num, sz = 0; ll gun = 0; cin >> num; ll lastd = num % 10; ///cout << lastd << endl; if(lastd % 2 == 0 || lastd == 5) cout << -1 << endl; else { /// cout << "Entered\n"; while(check(gun) == 0) { sz++; if(sz >= 10000000) { sz = -1; break; } ll need = ((7 - (gun % 10)) + 10) % 10; ll gg = 10; for(ll i = 0; i <= 9; i++) { if((i * lastd) % 10 == need) { gg = i; break; } } if(gg == 10) { sz = -1; break; } gun += (num * gg); /// cout << need <<' ' << gg << ' ' << gun << endl; gun /= 10; } sz += check(gun); cout << sz << endl; } }


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> using namespace std; #define ll long long ll check(ll n) { ll ret = 0; while(n) { if(n % 10 != 7) return 0; n /= 10; ret++; } return ret; } int main() { ll num, sz = 0; ll gun = 0; cin >> num; ll lastd = num % 10; ///cout << lastd << endl; if(lastd % 2 == 0 || lastd == 5) cout << -1 << endl; else { /// cout << "Entered\n"; while(check(gun) == 0) { sz++; if(sz >= 10000000) { sz = -1; break; } ll need = ((7 - (gun % 10)) + 10) % 10; ll gg = 10; for(ll i = 0; i <= 9; i++) { if((i * lastd) % 10 == need) { gg = i; break; } } if(gg == 10) { sz = -1; break; } gun += (num * gg); /// cout << need <<' ' << gg << ' ' << gun << endl; gun /= 10; } sz += check(gun); cout << sz << endl; } }
      |                          ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.util.*;

public class Main{
 	public static void main(String args[]){
    	Scanner sc = new Scanner();
      	int mod = sc.nextInt();
      	int val = 7%mod;
      	for(int i =0;i<1e7; i++){
         	if(val==0){
              	System.out.println(i);
          		return;
            }
          	val = (val*10+7)%mod;
  
          
        }
      
      	System.out.println("-1");
    } 
}

Compiler output:
Main.java:5: error: no suitable constructor found for Scanner(no arguments)
    	Scanner sc = new Scanner();
    	             ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error