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

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll MOD = 1e9 + 7;

ll get(ll x, ll y) {
  ll res = 1ll;
  while(y) {
    if(y & 1) {
      res = (res * x) % MOD; 
    }
    y >>= 1;
    x = (x * x) % MOD;
  }
  return res;
}

void solve() {
  int n, k; cin >> n >> k;
  vector <ll> cur(n + 1);
  for(int i = 1; i <= k; i++) {
    cur[i] = get((k / i), n);
  }
  for(int i = k; i >= 1; i--) {
    for(int j = i + i; j <= k; j += i) {
      cur[i] -= cur[j];
      cur[i] %= MOD;
      if(cur[i] < 0) cur[i] += MOD;
    }
  }
  ll ans = 0;
  for(ll i = 1; i <= k; i++) {
    //cout << cur[i] << '\n';
    ans = (ans + i * cur[i]) % MOD;
  }
  cout << ans << '\n';
}

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

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

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

#define endl '\n'
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << ends << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 2e9;
const ll MOD = 1e9 + 7;
 
////////////////////////////////////////////////////////////////////

const int N = 1e5 + 5;

int F[N];

int Power(int a, int b) {
	int res = 1;
	for (; b; b >>= 1, a = 1LL * a * a % MOD) if (b & 1) res = 1LL * res * a % MOD;
	return res;
}

int main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	mt19937 Rnd(time(0));

	int n, k, ans = 0; cin >> n >> k;
	for (int i = k; i >= 1; i--) {
		F[i] = Power(k / i, n);
		for (int j = i + i; j <= k; j += i) F[i] = (F[i] + MOD - F[j]) % MOD;
		ans = (ans + 1LL * i * F[i] % MOD) % MOD;
	}
	cout << ans << endl;

	return 0;
}


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

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

typedef long long int ll;
ll mod = 1000000000 + 7;
ll gcd[100000];

ll _acc(ll &acc){
    acc %= mod;
    return acc;
}

ll _pow(ll base, ll exp){
    ll ans = 1;
    ll temp = base;
    while(exp > 0){
        if(exp & 1) ans *= temp, _acc(ans);
        temp *= temp; _acc(temp);
        exp /= 2;
    }
    return ans;
}

int main(){
    ll n, ans = 0, k; cin >> n >> k;
    for(int i = k; i >= 1; i--){
        gcd[i - 1] = _pow(k/i, n);

        // cout << gcd [i - 1] << " ";

        for(int j = 2*k; j <= k; j += k)
            gcd[i - 1] -= gcd[j - 1];

        ans += gcd[i - 1]; _acc(ans);
        // cout << gcd[i - 1] << endl;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: reference to 'gcd' is ambiguous
   27 |         gcd[i - 1] = _pow(k/i, n);
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:4: note:                 'll gcd [100000]'
    6 | ll gcd[100000];
      |    ^~~
a.cc:32:13: error: reference to 'gcd' is ambiguous
   32 |             gcd[i - 1] -= gcd[j - 1];
      |             ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:4: note:                 'll gcd [100000]'
    6 | ll gcd[100000];
      |    ^~~
a.cc:32:27: error: reference to 'gcd' is ambiguous
   32 |             gcd[i - 1] -= gcd[j - 1];
      |                           ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:4: note:                 'll gcd [100000]'
    6 | ll gcd[100000];
      |    ^~~
a.cc:34:16: error: reference to 'gcd' is ambiguous
   34 |         ans += gcd[i - 1]; _acc(ans);
      |                ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:6:4: note:                 'll gcd [100000]'
    6 | ll gcd[100000];
      |    ^~~
Language: C

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

// #pragma GCC optimize("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long long ll; 
typedef long double ld; 
typedef pair<int,int> p32;   
typedef pair<ll,ll> p64;  
typedef pair<double,double> pd; 
typedef pair<ld,ld> pld; 
typedef vector<int> v32;  
typedef vector<ll> v64;  
typedef vector<pd> vpd;   
typedef vector<p32> vp32;  
typedef vector<p64> vp64;  
typedef vector<v32> vv32;  
typedef vector<v64> vv64;  

#define pb push_back
#define mp make_pair
#define prarr(a,n) cerr<<#a<<" : ";for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define prmat(mat,row,col) cerr<<#mat<<" :\n";for(ll i=0;i<row;i++) {for(ll j=0;j<col;j++) cerr<<mat[i][j]<<"\t";cerr<<endl;}
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
#define all(a) a.begin(),a.end()
#define sz(x) ((int)x.size())
#define endl '\n'
#define fast_io ios_base::sync_with_stdio(NULL); cin.tie(NULL)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {ll idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
template <class T> void prall(T a) { prc(all(a)); }

#include <bits/extc++.h> /** keep-include */
using namespace __gnu_pbds;
template <class T>
using Tree = tree<T, null_type, less<T>, rb_tree_tag,
        tree_order_statistics_node_update>;

const int inf=1000*1000*1000+9; 
const ll infl=1ll*inf*inf; 
int mod=1000*1000*1000+7;  
// ----------------------------------------------------------------------------	-------------- 

void pre(){
}
int exp(ll a, int b){
  ll ret=1; 
  while(b){
    if(b%2==0){
      a=a*a%mod; 
      b>>=1;
    }
    else {
      ret=ret*a%mod;  
      b--; 
    }
  }
  return ret; 
}
void solve(){
  int n,k; cin>>n>>k; 
  vector<int> seq(k+1,0); 
  for(int i=k;i>=1;i--){
    seq[i]=exp(k/i,n); 
    for(int j=i+i;j<=k;j+=i){
      seq[i]-=seq[j]; 
      if(seq[i]<0) seq[i]+=mod; 
    }
  }
  ll ans=0; 
  for(int i=1;i<=k;i++){
    ans+=1ll*i*seq[i]; 
    ans%=mod; 
  }
  cout<<ans<<endl; 
}



int main(){
	// clock_t beg=clock(); 
  fast_io; 
  int testcases=1; 
  pre(); 
  // cin>>testcases; 
  cout << fixed << setprecision(13); 
  int cs=0; 
  while(testcases--){
    cs++; 
    // cout<<"Case #"<<cs<<": "; 
    solve(); 	
  }
	// clock_t end=clock(); 
	// fprintf(stderr, "%lf\n", (double)(end-beg)/(CLOCKS_PER_SEC));
}





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

#include<bits/stdc++.h>

using namespace std;

#define S scanf
#define P printf
#define G getline
#define SZ size()
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define MP make_pair
#define LL long long int
#define ULL unsigned long long int
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>
#define PLI pair<long long int,int>
#define PLL pair<long long int,long long int>
#define MII map<int,int>
#define MSI map<string,int>
#define MIS map<int,string>
#define MLI map<long long int,int>
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)





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




LL big_mod(LL val,LL pow,LL mod)
{
    LL res = 1;
    val = val % mod;
    while(pow > 0)
    {
        if(pow & 1)
        {
            res = (res*val) % mod;
        }
        pow = pow >> 1;
        val = (val*val) % mod;
    }
    return res;
}

int main()
{
    FAST();

//    freopen("input.txt","r",stdin);
//    freopen("output.txt","w",stdout);

    LL i,j,k,n,ans=0;
    const LL mod=1e9+7;
    cin >> n >> k;
    LL cnt[k+5];
    for(i=1;i<=n;i++)cnt[i]=big_mod(k/i,n,mod);
    for(i=k;i>0;i--)
    {
        for(j=i+i;j<=k;j+=i)cnt[i]=(cnt[i]-cnt[j]+mod)%mod;
    }
    for(i=1;i<=k;i++)ans=(ans+(cnt[i]*i)%mod)%mod;
    cout << ans;
    return 0;
}


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

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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }

class modint {
  private:
    ll m_val;
    ll m_mod;
  public:
    constexpr modint() : m_val(0), m_mod() { m_mod = MOD; }
    constexpr modint(const ll x) : m_val(0), m_mod(0) { m_mod = MOD; m_val = x % m_mod; }
    constexpr modint(const ll x, const ll mod) : m_val(0), m_mod(0) { m_mod = mod; m_val = x % m_mod; }
    constexpr ll val() const { return m_val; }
    constexpr modint operator+(const modint &rhs) const { return modint(*this) += rhs; }
    constexpr modint operator-(const modint &rhs) const { return modint(*this) -= rhs; }
    constexpr modint operator*(const modint &rhs) const { return modint(*this) *= rhs; }
    constexpr modint operator/(const modint &rhs) const { return modint(*this) /= rhs; }
    constexpr modint &operator+=(const modint &rhs) {
      m_val += rhs.m_val;
      if (m_val >= m_mod) m_val -= m_mod;
      return *this;
    }
    constexpr modint &operator-=(const modint &rhs) {
      if (m_val < rhs.m_val) m_val += m_mod;
      m_val -= rhs.m_val;
      return *this;
    }
    constexpr modint &operator*=(const modint &rhs) {
      m_val = m_val * rhs.m_val % m_mod;
      return *this;
    }
    constexpr modint &operator/=(const modint &rhs) {
      *this *= rhs.pow(m_mod - 2);
      return *this;
    }
    constexpr modint pow(ll n) const {
      if (n == 0) return 1;
      modint o = pow(n >> 1);
      o *= o;
      if (n & 1) o *= *this;
      return o;
    }
    friend ostream& operator<<(ostream& os, const modint &a) { os << a.val(); return os; }
};

ll modpow(ll x, ll n) {
  ll res = 1;
  while (n != 0){
    if (n & 1) res = res * x % MOD;
    x = x * x % MOD;
    n = n >> 1;
  }
  return res;
}

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

  vector<ll> memo(k+1);
  for (ll i = k; i >= 1; --i) {
    ll a = modpow(k/i, n);
    memo[i] = a;
    for (ll j = 2; i*j <= k; ++j) {
      memo[i] -= memo[i*j];
    }
  }

  modint ans(0);
  for (ll i = 1; i <= k; ++i) {
    ans += (i * memo[i]);
  }
  cout << ans.val() << 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 FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
ll n,k;
int prime[100010];
bool is_prime[100010];
int sieve(int n){
    int p=0;
    for(int i=0;i<=n;i++) is_prime[i]=true;
    is_prime[0]=is_prime[1]=false;
    for(int i=2;i<=n;i++){
        if(is_prime[i]){
            prime[p++]=i;
            for(int j=2*i;j<=n;j+=i) is_prime[j]=false;
        }
    }
}
int main(){
    cin>>n>>k;
    int a = sieve(k); //k以下の素数を求める
    ll ans=0;
    for(int i=2;i<=k;i++){
        if(is_prime[i]){
            int cnt=0;
            int copy=i;
            while(copy<=k){
                copy+=i;
                cnt++;
            }
            int copy2=cnt;
            while(cnt>=0){
                if(cnt==0){
                    ans+=1;
                }
                else{
                    ll aaa=pow(copy2-cnt,n-1)%MOD
                    ans+=aaa;
                } 
                //ans+=pow(copy2-cnt,n-1)%MOD;
            }
        }
    }
    ans+=pow(a,n-1);
    cout<<ans<<endl;
    return 0;
}

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

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

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
#define rep(i, n) for(int i = 1; i <= (int)(n); i++)
  int64_t N,K;
  int64_t answer=0;
  cin>>N>>K;
  vector<int64_t> r(K),s(K);
  rep(i,K){
    r[i]=modpow(K/i, N, 1000000007 );
  }
  //[K/i]のN乗のリスト
  //i番目にiが乗ってる
  //rep(i,K)
    //cout<<r[i]<<endl;
  for(int i=K;i>=1;i--){
    for(int j=2;j<=K;j++){
      if(i*j>K)
        break;
      r[i]-=r[j*i];
    }  
  }
  for(int i=K;i>=1; i--){
    answer+=r[i]*(i)%1000000007;
    answer=answer%1000000007;
  }
  if(answer<0)
    cout<<answer+1000000007;
  else
    cout<<answer;
}

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++

int mod_pow(int x,int a,int m=MOD){
    if(a==0)return 1;
    int res=mod_pow(x,a/2,m);
    res=res*res%m;
    if(a%2)res*=x;
    return res%m;
}

int inv(int x,int m=MOD){
    return mod_pow(x,m-2,m);
}

int n, k;
int dp[110000];
int exactly[110000];
int ans;

int main(){
    cin>>n>>k;
    for(int g=1;g<=k;g++){
        dp[g]=mod_pow(k/g,n)
    }
    for(int g=k;g>=1;g--){
        exactly[g]=dp[g];
        for(int gg=2*g;gg<=k;gg+=g){
            exactly[g]-=exactly[gg];
        }
        exactly[g]%=Mod;
        ans += exactly[g]*g;
        ans%=MOD;
    }
    if(ans<0)ans+=MOD;
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:1:31: error: 'MOD' was not declared in this scope
    1 | int mod_pow(int x,int a,int m=MOD){
      |                               ^~~
a.cc:9:21: error: 'MOD' was not declared in this scope
    9 | int inv(int x,int m=MOD){
      |                     ^~~
a.cc: In function 'int main()':
a.cc:19:5: error: 'cin' was not declared in this scope
   19 |     cin>>n>>k;
      |     ^~~
a.cc:28:21: error: 'Mod' was not declared in this scope
   28 |         exactly[g]%=Mod;
      |                     ^~~
a.cc:30:14: error: 'MOD' was not declared in this scope
   30 |         ans%=MOD;
      |              ^~~
a.cc:32:19: error: 'MOD' was not declared in this scope
   32 |     if(ans<0)ans+=MOD;
      |                   ^~~
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout<<ans<<endl;
      |     ^~~~
a.cc:33:16: error: 'endl' was not declared in this scope
   33 |     cout<<ans<<endl;
      |                ^~~~
Language: C

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

const int64_t MOD=1e9+7;

int64_t modpow(int64_t a,int64_t n){
  int64_t res=1;
  if(n==0) return res;
  while(n>0){
    if(n&1) res=(res*a)%MOD;
    a=(a*a)%MOD;
    n >>= 1;
  }
  return res;
}

int main(){
  int64_t N,K;
  cin>>N>>K;
  int64_t ans=0;

  
  //i|gcdなるような総数mod[i]
  vector<int64_t> mod(K+1,0);
  for(int i=1;i<=K;++i){
    mod[i]=modpow(K/i,N);
  }
  
  //i==gcdなるような総数dp[i]
  vector<int64_t> dp(K+1,0);
  for(int64_t i=K;i>=1;--i){
    dp[i]=mod[i];
    for(int64_t j=2;i*j<=K;++j){
      dp[i] += MOD-dp[i*j];
    }
    dp[i] %= MOD;
    ans += i*dp[i];
    ans %= MOD;
  }

  cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
using P=pair<long long,long long>;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD= 1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


ll modpow(ll a, ll n){
    if(n==0)return 1;
    if(n%2==0){
      ll t=modpow(a,n/2);
      return (t*t)%MOD;
    }
    return a*modpow(a,n-1)%MOD;
}
ll modinv(ll k){
  return modpow(k,MOD-2);
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);  
  
  ll n,k;
  cin >> n >> k;
  map<ll,ll>mp;
  
  ll ans=0;
  for(int i=k;i>=1;i--){
    ll cnt=modpow(k/i,n);
    mp[i]=cnt;
    for(int j=2;j*i<=k;j++){
      mp[i]=(mp[i]-mp[i*j]+MOD)%MOD;
    }
    ans+=i*mp[i]%MOD;
  }
  cout << ans << endl;
  
  
  
}


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

#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,k = LI()
    f = [-1]*(k+1)
    p = 2
    while p <= k:
        x = 2*p
        while x <= k:
            f[x] -= f[p]
            x += p
        p += 1
    ans = 0
    p = [1]
    for i in range(1,k+1):
        p.append(pow(k//i,n,mod))
    for i in range(1,k+1):
        res = p[i]
        x = 2*i
        j = 2
        while x <= k:
            res += p[x]*f[j]
            x += i
            j += 1
        ans += i*res
        ans %= mod
    print(ans%mod)
    return

#Solve
if __name__ == "__main__":
    solve()


Compiler output:
main.c:1:2: error: invalid preprocessing directive #!
    1 | #!usr/bin/env python3
      |  ^
main.c:2:1: error: unknown type name 'from'
    2 | from collections import defaultdict, deque
      | ^~~~
main.c:2:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    2 | from collections import defaultdict, deque
      |                  ^~~~~~
main.c:2:18: error: unknown type name 'import'
main.c:55:2: error: invalid preprocessing directive #Solve
   55 | #Solve
      |  ^~~~~
Language: C

#include <bits/stdc++.h>

using namespace std;
const int N = 1e5 + 5, MOD = 1e9 + 7;
int dp[N];

int mul(int a, int b) {return 1ll * a * b % MOD;}
int sum(int a, int b) {return (a + b) % MOD;}
int Pow(int a, int b) {
    int res = 1;
    for (; b; b>>=1, a = mul(a, a)) if (b&1) res = mul(res, a);
    return res;
}
int calc(int n) {
    int res = 0;
    for (int i = 2; i <= n;) {
        int j = n / (n / i) + 1;
        dp[n] = sum(dp[n], MOD - mul(dp[n/i], j - i));
        i = j;
    }
}
int main() {
    int n, k; cin >> n >> k;
    for (int i = 1; i <= k; i++) {
        dp[i] = Pow(i, n);
        calc(i);
    }
    int ans = 0;
    for (int i = 1; i <= k; i++) ans = sum(ans, mul(i, dp[k/i]));
    cout << ans << "\n";

    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>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
 }
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,k;
  cin>>n>>k;
  vll h(k+1);
  ll ans=0;
  for(int i=k;i>=1;i--){
    ll num=k/i;
    ll cu=modpow(num,n,MOD);
    ll now=i;
    ll ccu=2;
    while(now*ccu<=k){
      cu-=h[now*ccu];
      if(cu<0) cu+=MOD;
      ccu++;
    }
    h[i]=cu;
    ans+=i*cu;
    ans%=MOD;
  }
  COUT(ans);
}

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

/*input

*/


//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define pb          push_back
#define pii         pair<ll int,ll int>
#define vpii        vector< pii >
#define vi          vector<ll int>
#define vs			vector< string >
#define vvi         vector< vector< ll > >
#define inf			(ll)1e18
#define all(it,a)   for(auto it=(a).begin();it!=(a).end();it++) 
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define repr(i,a,b) for(ll int i=a;i>b;i--)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define whatis(x)   cout << #x << " is " << x << "\n";
#define graph(n)    adj(n,vector< ll > () )
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll mod = 1e9+7;
ll power(ll x,ll y)
{
	ll ans=1;
	while(y)
	{
		if(y&1) ans = (ans*x)%mod;
		y>>=1;
		x=(x*x)%mod;
	}
	return ans;
}
		
int solve()
{
	ll n,kk;cin>>n>>kk;
	ll ans=0;

	vi dp(kk+1);
	vi nd(kk+1);

	rep(k,1,kk+1)
	{
		for(ll j=1;j*j<=k;j++)
		{
			if(k%j==0)
			{
				nd[k]++;
				if(j*j!=k) nd[k]++;
			}
		}
		nd[k]--;
	}

	rep(k,1,kk+1)
	{
		if(k==1) dp[k]=1;
		else
		{
			ll t =((power(k,n))%mod-power(k-1,n)+mod)%mod;
			ll tt = power(nd[k],n);
			t = (t-tt+mod)%mod;
			dp[k] = (dp[k-1] + t)%mod;
		} 
		cout<<dp[k]<<"\n";
	}

	ll ans_temp = fun(10,5);


	rep(i,1,kk+1)
	{
		ll g = i;
		ll nn = kk/g;
		ll val = dp[nn];
		ans = (ans+(val*g)%mod)%mod;
	}
	cout<<ans<<"\n";
	return 0;
}

int main()
{
	auto start = chrono::high_resolution_clock::now();

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	ll test_cases=1;
	//cin>>test_cases;
	while(test_cases--)
		solve();

	auto stop = chrono::high_resolution_clock::now();
	auto duration = chrono::duration_cast<chrono::milliseconds>(stop-start);
	// cout<<"\nduration: "<<(double)duration.count()<<" milliseconds";
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:77:23: error: 'fun' was not declared in this scope
   77 |         ll ans_temp = fun(10,5);
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
#include "/home/itohdak/AtCoder/000/print.hpp"
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
ll binary_pow(ll a, ll N) {
  ll ans = 1;
  ll tmp = a;
  while(N > 0) {
    if(N % 2 == 1) {
      ans *= tmp;
      ans %= mod;
    }
    N /= 2;
    tmp *= tmp;
    tmp %= mod;
  }
  return ans;
}
int main() {
  int N, K;
  cin >> N >> K;
  ll ans = 0;
  vector<ll> cnt(K+1);
  RREP(i, K, 1) {
    cnt[i] = binary_pow(K/i, N);
    for(ll j=i*2; j<=K; j+=i) cnt[i] -= cnt[j];
    (ans += cnt[i] * i) %= mod;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:2:10: fatal error: /home/itohdak/AtCoder/000/print.hpp: No such file or directory
    2 | #include "/home/itohdak/AtCoder/000/print.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>


using namespace std;


const long long dev = 1000000007;
long long n, k;

vector<long long> kkk;


long long gcd(long long a, long long b) {

	if (a == b) return a;
	if (a < b) swap(a, b);

	while (a % b > 0) {
		long long c = a % b;

		a = b; b = c;
	}

	return b;
}



long long Let_pow(long long b, long long a) {

	if (kkk.size() > b) {
		return kkk[b];
	}

	long long answer = kkk[kkk.size() - 1];

	for (long long i = kkk.size() - 1; i < b; i++) {
		kkk.push_back((kkk[i] * a) % dev);
	}

	return kkk[b];
}



long long Calc(long long now, long long index) {

	long long answer = 0;

	if (index == 0) {
		for (int i = 1; i <= k; i++) {
			answer = (answer + Calc(i, 1)) % dev;
		}

		return answer;
	}
	else if (index < n - 1) {
		for (int i = 1; i <= k; i++) {
			long long makeGcd = gcd(now, i);
			if (makeGcd > 1) {
				answer = (answer + Calc(makeGcd, index + 1)) % dev;
			}
			else {
				answer =  (answer + Let_pow((n - index - 1), k)) % dev;
			}
		}
	}
	else {
		for (int i = 1; i <= k; i++) {
			answer = (answer + gcd(now, i)) % dev;
		}
	}

	return answer;
}

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

//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const ll INF = 1e9;
const ll LINF = ll(1e18);
const ll MOD = 1000000007;
const ll dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const ll Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (ll i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll n,k;
vector<ll> divisor(ll n)
{
    vector<ll> res;
    for (ll i = 1; i * i <= n; i++)
        if (n % i == 0)
        {
            res.push_back(i);
            if (i != n / i)
                res.push_back(n / i);
        }
    return res;
}
const ll M = pow(10, 9) + 7;

vector<ll> fac(1000001);  //n!(mod M)
vector<ll> ifac(1000001); //k!^{M-2} (mod M)
ll mpow(ll x, ll n)
{ //x^n(mod M)
    ll ans = 1;
    while (n != 0)
    {
        if (n & 1)
            ans = ans * x % M;
        x = x * x % M;
        n = n >> 1;
    }
    return ans;
}
//conbination
ll comb(ll a, ll b)
{ //aCb(mod M)
    if (a == 0 && b == 0)
        return 1;
    if (a < b || a < 0)
        return 0;
    ll tmp = ifac[a - b] * ifac[b] % M;
    return tmp * fac[a] % M;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>k;
    fac[0] = 1;
    ifac[0] = 1;
    for (ll i = 0; i < 1000000; i++)
    {
        fac[i + 1] = fac[i] * (i + 1) % M;              // n!(mod M)
        ifac[i + 1] = ifac[i] * mpow(i + 1, M - 2) % M; // k!^{M-2} (mod M)
    }
    ll ans=0;
    for(ll i=1;i<=k;i++){
        ll count=(k+i-1)/i;
        ans+=mpow(count,n);
        ans%=MOD;
    }
    cout << ans << "\n";
}


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

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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
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; }
//end

template<unsigned mod=1000000007>struct mint {
   unsigned val;
   static unsigned get_mod(){return mod;}
   unsigned inv() const{
      int tmp,a=val,b=mod,x=1,y=0;
      while(b)tmp=a/b,a-=tmp*b,swap(a,b),x-=tmp*y,swap(x,y);
      if(x<0)x+=mod; return x;
   }
   mint():val(0){}
   mint(ll x):val(x>=0?x%mod:mod+(x%mod)){}
   mint pow(ll t){mint res=1,b=*this; while(t){if(t&1)res*=b;b*=b;t>>=1;}return res;}
   mint& operator+=(const mint& x){if((val+=x.val)>=mod)val-=mod;return *this;}
   mint& operator-=(const mint& x){if((val+=mod-x.val)>=mod)val-=mod; return *this;}
   mint& operator*=(const mint& x){val=ll(val)*x.val%mod; return *this;}
   mint& operator/=(const mint& x){val=ll(val)*x.inv()%mod; return *this;}
   mint operator+(const mint& x)const{return mint(*this)+=x;}
   mint operator-(const mint& x)const{return mint(*this)-=x;}
   mint operator*(const mint& x)const{return mint(*this)*=x;}
   mint operator/(const mint& x)const{return mint(*this)/=x;}
   bool operator==(const mint& x)const{return val==x.val;}
   bool operator!=(const mint& x)const{return val!=x.val;}
}; using Mint=mint<>;
struct factorial {
   vector<Mint> Fact,Finv,Inv;
   factorial(int maxx){
      Fact.resize(maxx); Finv.resize(maxx); Inv.resize(maxx);
      Fact[0]=Fact[1]=Finv[0]=Finv[1]=Inv[1]=1; unsigned mod=Mint::get_mod();
      rep(i,2,maxx){
         Fact[i]=Fact[i-1]*i;
         Inv[i]=Inv[mod%i]*(mod-mod/i);
         Finv[i]=Finv[i-1]*Inv[i];
      }
   }
   Mint fact(int n,bool inv=0){if(inv)return Finv[n];else return Fact[n];}
   Mint inv(int n){return Inv[n];}
   Mint nPr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[n-r];}
   Mint nCr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[r]*Finv[n-r];}
};

int main(){
   int n,k; cin>>n>>k;
   vector<Mint> tmp(k+1);
   Mint res;
   rrep(i,k,0){
      tmp[i]=Mint(k/i).pow(n);
      for(int j=2*i;j<=k;j+=i)tmp[i]-=tmp[j];
      res+=tmp[i]*i;
   } printf("%d\n",res.val);
   return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define M1 1000000007
#define M2 998244353
#define fl(i,a,b) for(ll i=a;i<b;i++)
#define ifl(i,a,b) for(ll i=b-1;i>=a;i--)
#define V(a) vector<a>
#define bn "\n"

ll modI(ll a,ll m);
ll gcd(ll a,ll b);
ll powM(ll x,ll y,ll m);
ll swap(ll a,ll b);

void swap(ll& a,ll& b)
{
    ll tp=a;
    a=b;
    b=tp;
}

ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

ll powM(ll x,ll y,ll m)
{
    ll ans=1,r=1;
    x%=m;
    while(r>0&&r<=y)
    {
        if(r&y)
        {
            ans*=x;
            ans%=m;
        }
        r<<=1;
        x*=x;
        x%=m;
    }
    return ans;
}
 
ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

int main() {
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
	int t=1;
    //cin>>t;
	while(t--)
	{
	    int n,k;
	    cin>>n>>k;
      ll s=0;
	    for(int i=2;i<=k;i++)
	    {
	        int num=k/i;
	        s=s+(num-1)*pow(num,k-1);
	    }
	    s+=pow(num,k-1);
	    cout<<s<<bn;
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:86:20: error: 'num' was not declared in this scope; did you mean 'enum'?
   86 |             s+=pow(num,k-1);
      |                    ^~~
      |                    enum
Language: C++

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

int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
int main() {
  int N,K,sum=0,GCD,a=1;
  cin>>N>>K;
  
  rep(i,K){a*=N;}
  vector<vector<int>> vec(a,vector<int>(N))
  rep(k,a){
    rep(l,N){
    rep(n,K){
    vec.at(k).at(n)=l+1
    }
  }
  }
  GCD=vec.at(0)
  rep(i,N){rep(j,N){
  GCD=gcd(vec.at(i).at(j),GCD)
  }}
  sum+=GCD
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:19: error: expected ',' or ';' before 'for'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                   ^~~
a.cc:22:3: note: in expansion of macro 'rep'
   22 |   rep(k,a){
      |   ^~~
a.cc:22:7: error: 'k' was not declared in this scope
   22 |   rep(k,a){
      |       ^
a.cc:3:35: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
a.cc:29:13: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'} to 'int' in assignment
   29 |   GCD=vec.at(0)
      |       ~~~~~~^~~
      |             |
      |             __gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type {aka std::vector<int>}
a.cc:30:7: error: 'i' was not declared in this scope
   30 |   rep(i,N){rep(j,N){
      |       ^
a.cc:3:35: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
a.cc:33:11: error: expected ';' before '}' token
   33 |   sum+=GCD
      |           ^
      |           ;
   34 |   }
      |   ~        
a.cc: At global scope:
a.cc:35:3: error: 'cout' does not name a type
   35 |   cout<<sum<<endl;
      |   ^~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#pragma GCC optimize("Ofast,fast-math,unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int)v.size()
#define fi first
#define se second
#define sqrt(x) sqrt(abs(x))
#define sqr(x) ((x) * (x))
#define unq(x) (x.resize(unique(all(x)) - x.begin()))
#define fill(x, y) memset(x, y, sizeof(x))
#define mp make_pair
#define pb emplace_back
#define popcnt __builtin_popcount
#define ctz __builtin_ctz

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using ll = long long;
using ld = long double;

template <class T> using indexed_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T, class U>
istream& operator >> (istream &in, pair <T, U> &p) {
    in >> p.first >> p.second;
    return in;
}

template <class T, class U>
ostream& operator << (ostream &out, pair <T, U> &p) {
    out << p.first << ' ' << p.second;
    return out;
}

template <class T>
istream& operator >> (istream &in, vector <T> &a) {
    for (T &i: a) in >> i;
    return in;
}

template <class T>
ostream& operator << (ostream &out, vector <T> &a) {
    for (T i: a) out << i << ' ';
    out << '\n';
    return out;
}

template <class T>
ostream& operator << (ostream &out, set <T> &a) {
    for (T i: a) out << i << ' ';
    out << '\n';
    return out;
}

void fastIO() {
    ios_base:: sync_with_stdio(0);
    cin.tie(nullptr); cout.tie(nullptr);
}

const ll mod = 1000000007;

ll bp(ll a, ll b) {
    if (b == 0) return 1;
    
    if (b & 1) {
        return (a * bp(a, b - 1)) % mod;
    }
    
    else {
        ll h = bp(a, b / 2);
        return sqr(h) % mod;
    }
}

signed main() {
    fastIO();

    ll n, k;
    cin >> n >> k;
    
    vector <int> pr(n + 1, 0);
    pr[1] = 1;
    for (int i = 2; i <= n; ++i) {
        if (pr[i] == 1) continue;
        
        for (ll j = 2 * i; j <= n; j += i) pr[j] = 1;
    }
    
    ll ans = 0;
    for (int i = 1; i <= k; ++i) {
        ll d = k / i;
        ll cur = 0;
        
        cur += bp(d, n);
        for (int j = 2; j <= sqrt(d) + 1; ++j) {
            fi (pr[j] == 1) continue;
            cur -= bp(d / j, n);
            cur %= mod;
        }
        
        ans += (h * i * 1LL) % mod;
        ans %= mod;
    }
    
    cout << ans;

    return 0;
}

/// ЗАПУСКАЕМ ГУСЯ:
/*
     ▄▀▀▀▄
▄███▀░◐░░░▌
    ▌░░░░░▐
    ▐░░░░░▐
    ▌░░░░░▐▄▄
    ▌░░░░▄▀▒▒▀▀▀▀▄
   ▐░░░░▐▒▒▒▒▒▒▒▒▀▀▄
   ▐░░░░▐▄▒▒▒▒▒▒▒▒▒▒▀▄
    ▀▄░░░░▀▄▒▒▒▒▒▒▒▒▒▒▀▄
      ▀▄▄▄▄▄█▄▄▄▄▄▄▄▄▄▄▄▀▄
           ▌▌░▌▌
           ▌▌░▌▌
         ▄▄▌▌▄▌▌        */


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'first' was not declared in this scope
   10 | #define fi first
      |            ^~~~~
a.cc:102:13: note: in expansion of macro 'fi'
  102 |             fi (pr[j] == 1) continue;
      |             ^~
a.cc:107:17: error: 'h' was not declared in this scope
  107 |         ans += (h * i * 1LL) % mod;
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int P = 1e9 + 7;

int kpow(ll a, ll b) {
	ll res = 1;
	while(b) {
		if(b & 1) res = res * a % P;
		a = a * a % P;
		b >>= 1;
	}
	return res;
}
bool check(int a) {
	int cnt = 0;
	for(int i = 1; i * i <= a) if(a % i == 0) ++cnt;
	return cnt % 2 == 0;
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n, k;
	cin >> n >> k;
	int ans = 0;
	rep(i, 1, k + 1) {
		int res = (kpow(k / i, n)) % P * 1ll * i % P;
		if(check(i)) ans = (ans + res) % P;
		else ans = (ans - res + P) % P;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool check(int)':
a.cc:32:34: error: expected ';' before ')' token
   32 |         for(int i = 1; i * i <= a) if(a % i == 0) ++cnt;
      |                                  ^
      |                                  ;
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<limits>
#include<algorithm>
#include<string>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;



int main(){
    int n,k,t,s;
	cin>>n>>k;
	t=gcd(1,2);
	if()
	for(int i=3;i<pow(k,n);i++){
		//cout<<i<<endl;
		gcd(t,i)
	}


	if(k==1){
		cout<<1<<endl;
		return 0;
	}
	else{
		t=gcd(1,2);
		for(int i=0;i<pow(k,n)-2;i++){
			//cout<<i<<endl;
			s=gcd(gcd(i,i+1),i+2);

		}
	}
	cout<<s<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: expected primary-expression before ')' token
   18 |         if()
      |            ^
a.cc:21:25: error: expected ';' before '}' token
   21 |                 gcd(t,i)
      |                         ^
      |                         ;
   22 |         }
      |         ~
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<limits>
#include<algorithm>
#include<string>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;



int main(){
    int n,k,t,s;
	cin>>n>>k;
	t=gcd(1,2);
	if()
	for(int i=3;i<pow(k,n);i++){
		//cout<<i<<endl;
		gcd(t,i)
	}


	if(k==1){
		cout<<1<<endl;
		return 0;
	}
	else{
		t=gcd(1,2);
		for(int i=0;i<pow(k,n)-3;i++){
			//cout<<i<<endl;
			s=gcd(gcd(i,i+1),i+2);

		}
	}
	cout<<s<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: expected primary-expression before ')' token
   18 |         if()
      |            ^
a.cc:21:25: error: expected ';' before '}' token
   21 |                 gcd(t,i)
      |                         ^
      |                         ;
   22 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int P = 1e9 + 7;

int kpow(ll a, ll b) {
	ll res = 1;
	while(b) {
		if(b & 1) res = res * a % P;
		a = a * a % P;
		b >>= 1;
	}
	return res;
}
bool check(int a) {
	int cnt = 0;
	for(int i = 1; i * i <= a) if(a % i == 0) ++cnt;
	return cnt & 1;
}
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n, k;
	cin >> n >> k;
	int ans = 0;
	rep(i, 1, k + 1) {
		int res = (kpow(k / i, n)) % P * 1ll * i % P;
		if(check(i)) ans = (ans + res) % P;
		else ans = (ans - res + P) % P;
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool check(int)':
a.cc:32:34: error: expected ';' before ')' token
   32 |         for(int i = 1; i * i <= a) if(a % i == 0) ++cnt;
      |                                  ^
      |                                  ;
Language: C++

#include <iostream>
using namespace std;


long tuples_sum(int** table, int n, int k, int x) {
    if (n == 1)
        return x;
    else {
        long result = 0;
        for (int i = 0; i < k; i++) {
            result += tuples_sum(table, n - 1, k, table[x][i]);
        }
        return result;
    }
}

int main() {
    int n, k;
    long result = 0;
    cin >> n >> k;
    int** table = (int**) malloc(sizeof(int*) * k);
    for (int i = 0; i < k; i++) {
        table[i] = (int*) malloc(sizeof(int) * k);
        for (int j = 0; j < k; j++)
            table[i][j] = __gcd(i + 1, j + 1);
    }
    for (int i = 0; i < k; i++)
        result = (result + tuples_sum(table, n - 1, k, i)) % 1000000007;
    cout << result;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:27: error: '__gcd' was not declared in this scope
   25 |             table[i][j] = __gcd(i + 1, j + 1);
      |                           ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
const long long mod = 1e9 + 7;

long long binpow (long long a, long long b) {
	long long res = 1, t = a;
	while (b) {
		if (b & 1) 
			(res *= t) %= mod;
		b >>= 1; 
		(t *= t) %= mod;
	}
	return res;
}

signed main () {
	long long n, k;
	cin >> n >> k;
	vector < long long > cands(k + 1, 0LL);
	for (int i = 1; i <= k; ++i) {
		for (int j = i; j <= k; j += i) 
			++cands[i];
	}
	long long ans1 = 0;
	for (long long i = 1; i <= k; ++i) 
		(ans1 += ((i * ((binpow(cands[i], n) - binpow(cands[i] - 1, n) + mod) % mod)) % mod)) %= mod;
	long long ans2 = 0;
	for (long long i = 1; i <= k; ++i)
		(ans2 += ((binpow(k - cands[i] + 1, n) - 1 + 2 * mod - binpow(k - cands[i], n)) % mod) %= mod;
	cout << (ans1 + ans2) % mod << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:97: error: lvalue required as left operand of assignment
   30 |                 (ans2 += ((binpow(k - cands[i] + 1, n) - 1 + 2 * mod - binpow(k - cands[i], n)) % mod) %= mod;
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:30:110: error: expected ')' before ';' token
   30 |                 (ans2 += ((binpow(k - cands[i] + 1, n) - 1 + 2 * mod - binpow(k - cands[i], n)) % mod) %= mod;
      |                 ~                                                                                            ^
      |                                                                                                              )
Language: C++

#include <bits/stdc++.h>
#include<queue>
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef pair<string,string> Pstring;
typedef pair<double,double> Pdouble;

#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)

ll MOD = 1e9+7;

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}

vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

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

  ll answer = 0;
  REP1(i,k){
    if(i==1){
      answer += mod(modpow(k,n,MOD)-modpow(k-1,n,MOD),MOD);
    }else{
      ll a = mod(modpow(k-(i-1),n, MOD)-modpow(k-(i-1)-1,n, MOD),MOD);

      vector<ll> yaku = divisor(i);
      vector<ll> yakkazu(yaku.size());
      REP(j,yaku.size()){
        yakkazu.at(j) = k/yaku.at(j);
      }
      for(int j=yaku.size()-1;j>0; j--){
        for(int k=j+1;k<yaku.size();k++){
          if(yaku.at(k)%yaku.at(j)==0){
            yakkazu.at(j)-=yakkazu.at(k);
          }
        }
      }

      REP(j,yaku.size()){
        answer += yaku.at(j)*yakkazu.at(j)%MOD;
      }
    }
  }

  cout << answer%MOD << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:32: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   54 |       vector<ll> yaku = divisor(i);
      |                         ~~~~~~~^~~