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

#include<algorithm>
#include<cmath>
#include<cstdio>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;
const ll mod = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)

#define vll    vector<ll>
#define vvll   vector<vector<ll>>
#define all(x) (x).begin(),(x).end()


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


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

    //counts[i] := iの倍数のN乗の個数 - 「iの倍数の倍数」の個数
    vector<ll> counts(K + 1, 0);

    for (int i = K; i >= 1; i--)
    {
        counts[i] = modpow(K / i, N);

        for (int j = 2 * i; j <= K; j += i)
        {
            counts[i] -= counts[j];
            if (counts[i] < 0) counts[i] += mod;
        }
    }

    ll count = 0;

    reple(i, 1, K)
    {
        count += i * counts[i];
        count %= mod;
    }

    cout << count << endl;

	return 0;
}

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

program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,k,i,j,ans
    integer(int64), allocatable:: gcn(:)
    integer(int64),parameter:: md = 1000000007

    read*, n,k
    allocate(gcn(k))

    do i=1,k
        gcn(i) = calc_rj(k/i, n)
    end do

    do i=k,1,-1
        j=2
        do while(i*j <= k)
            gcn(i) = gcn(i) - gcn(i*j)
            j=j+1
        end do
    end do

    ans=0
    do i=1,k
        ans=mod(ans+gcn(i)*i,md)
    end do

    print*, ans

contains
    function calc_rj(x,y) result(ret)
        integer(int64):: x,y,ret
        integer(int64):: num, nx
        ret = 1
        num = y
        nx = x
        do while(num > 0)
            if (btest(num,0)) then
                ret=mod(ret*nx,md)
            end if
            nx=mod(nx*nx,md)
            num=rshift(num,1)
        end do
    end function
end program name    

Compiler output:
main.c:1:1: error: unknown type name 'program'
    1 | program name
      | ^~~~~~~
main.c:2:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'use'
    2 |     use,intrinsic :: iso_fortran_env
      |     ^~~
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<cmath>
#include<deque>
#include<map>

using namespace std;
typedef long long ll;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define INF 1LL << 60
#define MAX 1000000000
const int MOD = 1000000007;
int gcd(int p, int q) { return p % q ? gcd(q, p % q) : q; }
long long modpow(long long a, long long n) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}
ll dp[100001], s;
int main() {
	int N, K;
	scanf("%d%d", &N, &K);
	rep(l, 1, K + 1) {
		dp[l] += l;
		for (int m = l * 2; m <= K; m += l) {
			dp[m] -= dp[l];
		}
		s += modpow(K / l, N) * dp[l];
		s %= MOD;
	}
	printf("%lld\n", s);
	return 0;
}

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

//#define _GLIBCXX_DEBUG
#include <iostream>
#include <bits/stdc++.h>
    
    
using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define REV(v) reverse(v.begin(),v.end())
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cout(n) cout<<fixed<<setprecision(n)
#define dout(n) cout<<# n<<" = "<<n<<endl;
#define v1out(v) FOR(j,0,v.size()){cout<<v[j]; if(j!=(ll)v.size()-1)cout<<" ";else cout<<endl; }
#define v2out(v) FOR(i,0,v.size())v1out(v[i]);
const int MOD = 1e9 + 7;

// a^b O(log b)
template <typename T>
T mypow(T a, T b) {
  if (b == 0) return 1;
  T tmp = mypow(a, b / 2);
  if (b % 2)
    return (((tmp * tmp) % MOD) * a) % MOD;
  else
    return (tmp * tmp) % MOD;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,k; cin>>n>>k;
    vector<ll> func(k+1);
    FORr(i,1,k+1){
      func[i] = mypow(k/i,n);
      FOR(j,2,k+1){
        if(i*j>k)break;
        func[i] -= func[i*j];
        (func[i] += MOD) %= MOD;
      }
    }
    ll ans = 0;
    FOR(i,1,k+1) (ans+= (func[i]*i+MOD)%MOD) %=MOD;
    cout<<ans<<endl;
}

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

#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;
const int mod = 1000000007;

struct mint{

  ll x;
  mint(ll x = 0):x((x % mod + mod) % mod){};
  mint pow(ll y) const {
    mint res(1);
    mint a(x);
    while(y>0){
      if(y&1) res *= a;
      a *= a;
      y >>= 1;
    }
    return res;
  }
  mint inv() const{ return pow(mod-2); }
  mint& operator+= (const mint a) noexcept {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-= (const mint a) noexcept {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*= (const mint a) noexcept {
    (x *= a.x) %= mod;
    return *this;
  }
  mint& operator/= (const mint a) noexcept {
    return (*this) *= a.inv();
  }
  mint operator+ (const mint a) const noexcept {
    mint res(*this);
    return res += a;
  }
  mint operator- (const mint a) const noexcept {
    mint res(*this);
    return res -= a;
  }
  mint operator* (const mint a) const noexcept {
    mint res(*this);
    return res *= a;
  }
  mint operator/ (const mint a) const noexcept{
    mint res(*this);
    return res /= a;
  }
};

ostream& operator<<(ostream& stream, const mint& n){
  stream << n.x;
  return stream;
};

struct comb{
  vector<mint> fact, ifact;
  comb(int n): fact(n+1), ifact(n+1){
    fact[0] = 1;
    for(int i = 1; i <= n; i++) fact[i] = fact[i-1] * i;
    ifact[n] = fact[n].inv();
    for(int i = n; i >= 1; i--) ifact[i-1] = ifact[i] * i;
  }
  mint operator()(int n, int k) const noexcept{
    if(k < 0 || n < k) return 0;
    return fact[n] * ifact[k] * ifact[n-k];
  }
};

int main(void){
  ll n, k;
  cin >> n >> k;
  vector<mint> num(k+1, 0);
  FORre(i, k+1, 1){
    num[i] = mint(k/i).pow(n);
    for(ll j = 2; i*j <= k; j++){
      num[i] -= num[i*j];
    }
  }
  mint ans = 0;
  REP(i, k+1) ans += num[i]*i;
  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

/*input
100000 100000
*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>*/
using namespace std;
/*using namespace __gnu_pbds;
typedef tree<long long, null_type, less_equal<long long>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;*/
#pragma GCC optimize("unroll-loops,no-stack-protector")
//order_of_key #of elements less than x
// find_by_order kth element
typedef long long ll;
typedef long double ld;
#define pii pair<int,int>
#define f first
#define s second
#define pb push_back
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define FILL(n,x) memset(n,x,sizeof(n))
#define ALL(_a) _a.begin(),_a.end()
#define sz(x) (int)x.size()
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
const ll INF64=4e18;
const int INF=0x3f3f3f3f;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld eps=1e-9;
#define lowb(x) x&(-x)
#define MNTO(x,y) x=min(x,(__typeof__(x))y)
#define MXTO(x,y) x=max(x,(__typeof__(x))y)
ll mult(ll a,ll b){
    return ((a%MOD)*(b%MOD))%MOD;
}
ll mypow(ll a,ll b){
    if(b<=0) return 1;
    ll res=1LL;
    while(b){
        if(b&1) res=mult(res,a);
        a=mult(a,a);
        b>>=1;
    }
    return res;
}
const ll maxn=1e5+5;
const ll maxlg=__lg(maxn)+2;
ll dp[maxn];
int32_t main(){
    ios::sync_with_stdio(false),cin.tie(0);
    int n,k;
    cin>>n>>k;
    ll ans=0;
    for(ll z=k;z>=1;z--){
        ll tmp=mypow((k/z),n);
        for(int j=z*2;j<=k;j+=z){
            tmp=(tmp-dp[j]+MOD)%MOD;
        }
        dp[z]=tmp;
        ans+=mult(tmp,z);
        ans%=MOD;
    }
    cout<<ans;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll dp[100005];
ll qpow(ll a,ll b)
{
	if(b==0) return 1;
	ll c=qpow(a,b/2);
	if(b%2==0) return c*c%mod;
	else return c*c%mod*a%mod;
}
int main()
{
	ll n,k;
	scanf("%lld%lld",&n,&k);
	ll sum=0;
	for(ll i=k;i>0;i--)
	{
		dp[i]=(qpow(k/i,n))%mod;
		for(ll j=i*2;j<=k;j+=i) dp[i]=(dp[i]-dp[j]+mod)%mod;
		sum=(sum+dp[i]*i)%mod;
	}
	printf("%lld",sum);
}

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;
typedef long long int ll;
int num=1e9+7;
//繰り返し二乗法
ll ex(ll x,ll n){
    if(n==0)return 1;
    else if(n%2==1)return ex(x,n-1)*x%num;
    else return ex(x*x%num,n/2)%num;
};
int main(){
    ll n,k;
    cin >> n >> k;
    map<ll,ll> mp;
    //cout << "OK!" << endl;
    for(ll i=2; i<=k; i++){
        mp[i]=(k/i)-(k/(i*i));
    }
    //cout << "OK" << endl;
    cout << mp[2] << endl;
    ll tmp=0;
    ll sum=0;
    for(int i=2; i<=k; i++){
        ll a=ex(mp[i],n)-1;
        sum+=(a*i)%num;
        sum%=num;
        tmp+=mp[i];
        tmp%=num;
    }
    sum+=ex(k,n)-tmp;
    cout << sum << 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 fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef pair<double,double> PD;
typedef pair<int,P> ed;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;

struct mint {
  ll x;
  mint(ll x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
      mint a = pow(t>>1);
      a *= a;
    if (t&1) a *= *this;
      return a;
  }
   mint inv() const { return pow(MOD-2);}
   mint& operator/=(const mint a) { return *this *= a.inv();}
   mint operator/(const mint a) const { return mint(*this) /= a;}
};
typedef vector<mint> vm;
typedef vector<vm> vvm;

int main() {
  int N,K;
  cin >> N >> K;
  mint ans = 0;
  vm dp(K,0);
  drep(x,K+1) {
    if(!x) break;
    mint res = K/x;
    res = res.pow(N);
    dp[x] = res;
    for(int k=2*x;k<=K;k+=x) {
      dp[x] -= dp[k];
    }
    ans += dp[x]*x;
  }
  cout << ans.x << 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 ll          long long int
#define lld          long double
#define pb          push_back
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define vec         vector<ll>
#define all(a)     (a).begin(),(a).end()
#define F           first
#define S           second
#define mod         1000000007
#define nmod         -1000000007
#define N            1000000//31630=sqrt(pow(10,9))
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define repi(i,a,b)	for(ll  i=a;i<=b;i++)
#define per(i,a,b)  for(ll i=a;i>=b;i--)
#define mp          make_pair
#define mit         map<ll,ll>::iterator
#define sit         set<ll>::iterator
#define pit         pair<ll,ll>::iterator
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;
ll xo(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}  
ll bin_Expo(ll x,ll n)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return bin_Expo(x*x,n/2);
    else                             //n is odd
        return x*bin_Expo(x*x,(n-1)/2);
}
ll mod_Expo(ll x,ll n,ll M)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return mod_Expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*mod_Expo((x*x)%M,(n-1)/2,M))%M;
 
}
//bool pf[N+1ll];
//vec prim;
//void sieve()
//{
//    repi(i,0,N)
//    pf[i]=true;
//	pf[0] = pf[1] = false;
//    for (int i = 2; i <= N; i++) {
//        if (pf[i]) 
//		{
//            prim.push_back(i);
//            for (int j = i + i; j <= N; j+=i) {
//                pf[j] = false;
//            }
//        }
//    }
//}
bool prime_check(ll x)
{
    bool prime = (x >= 2);
    for (ll i = 2; i * i <= x; i++) 
    {
        if (x % i == 0) 
        {
            prime = false;
            break;
        }
    }
    return prime;
}
ll logg(ll base,ll x) 
{
    return (ll)(log(x) / log(base));
}
ll a[100005];
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS; 
    while(TESTS--)
    {
    	ll m,k,g,i,ans,l,n,h,j,mx,my,d,x;
    	cin>>n>>k;
    	per(i,k,1)
    	{
    		a[i]=k/i;
    		a[i]=mod_Expo(a[i],n,mod);
    		for(j=2*i;j<=k;j+=i)
    		a[i]=(a[i]-a[j]+mod)%mod;
    		ans=(ans+a[i]*i)%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 <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <complex>
 
 
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
 
 
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
 
const int MOD =  1e9 + 7; 
 
 
 
ll power(ll a, ll b){
	if(b == 0) return 1;
	else {
		ll x = power(a,b/2);
		x = (x*x)%MOD;
		if(b&1) return (x*a)%MOD;
		else return x;
	}
}
 
 
ll& Mod(ll& a) {
    if (a >= MOD) {
        return Mod(a -= MOD);
    } else if (a < 0) {
        return Mod(a += MOD);
    } else {
        return a;
    }
}
 
ll gcd(ll a, ll b) { 
	// b < a
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 

const int N = 1e5 + 100;
ll cnt[N];
int main() {
	fast_cin();	
	ll n, k; cin >> n >> k;

	ll ans = 0;
	for(ll i = k; i >= 1; i--){
		cnt[i] = 0;
		Mod(cnt[i] += power(k/i, n));
		for(ll j = 2*i; j <= k; j+=i) { 
			Mod(cnt[i] -= cnt[j]);
		}
		//debug(i, cnt);
		Mod(ans += (cnt[i]*i)%MOD);
	}
	
	cout << ans << '\n';
}


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

#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=max(a, b)
#define chmin(a, b) (a)=min(a, b)
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;


/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/

ll moP(ll x, ll n) {
  ll res=1;
  while(n>0) {
    if(n&1) moC(res, *, x);
    moC(x, *, x);
    n>>=1;
  }
  return res;
}

map<ll, ll> prm;
void factrization(ll n) {
  for(ll i=2; i*i<=n; i++) {
    while(n%i==0) {
      prm[i]++;
      n/=i;
    }
  }
  
  if(n>1) prm[n]++;
}

map<ll, ll> mp;
void divisor(ll n) {
  for(ll i=1; i*i<=n; i++) {
    if(n%i==0) {
      mp[i]++;
      mp[n/i]++;
    }
  }
}

int main() {
  ll i, j, k;
  
  ll N, K;
  cin >> N >> K;
  
  divisor(K);
  ll ans=0;
  for(auto it=mp.begin(); it!=mp.end(); it++) {
    ll t=it->ft;
    
    prm.clear();
    factrization(K/t);
    ll cnt=1;
    for(auto jt=prm.begin(); jt!=prm.end(); jt++) {
      moC(cnt, *, (moP(jt->sc+1, N)-moP(jt->sc, N)+MOD)%MOD);
    }
    
    
    
    moC(ans, +, t*cnt);
    
  }
  
  pt(ans);
}




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 <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
 
using namespace std;
typedef long long ll;
const int MOD=1000000007;

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

  vector<ll> r(K+1,1);

  ll ans=0;
  for(ll i=K;0<i;i--){
    ll t=K/i; t%=MOD;
    for(int j=0;j<20;j++){
      if((N>>j)&1){
	r[i]*=t; r[i]%=MOD;
      }
      t*=t; t%=MOD;
    }
    
    for(int j=2;i*j<=K;j++){
      r[i]-=r[i*j]; r[i]%=MOD;
    }
    ans+=r[i]*i; ans%=MOD;
    //    cout << i << " " << r[i] << endl;
  }

  cout << (ans+MOD)%MOD << endl;
      
  return 0;
}


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

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

using LL = long long;
const LL MOD = 1e9+7;

LL modpow(LL a, LL n) {
    LL ret = 1, tmp = a;
    while (n) {
        if (n & 1) (ret *= tmp) %= MOD;
        (tmp *= tmp) %= MOD;
        n >>= 1;
    }
    return ret;
}


int main()
{
    // O(KlogN + KloglogK)

    int N, K; cin >> N >> K;

    vector<LL> f(K+1);
    for (int d = 1; d <= K; ++d) {
        f[d] = modpow(K / d, N);
    }

    vector<bool> isprime(K+1, true);
    for (int p = 2; p <= K; ++p) {
        if (!isprime[p]) continue;
        for (int i = 1; i * p <= K; ++i) {
            isprime[i * p] = false;
            (f[i] -= f[i * p]) %= MOD;
            if (f[i] < 0) f[i] += MOD;
        }
    }

    LL ans = 0;
    for (int d = 1; d <= K; ++d) {
        (ans += f[d] * d) %= MOD;
    }

    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 <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <iterator>
#include <functional>
#include <limits>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <stack>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define trace(x) cerr << #x << ": " << x << " " << endl;
 
typedef int64_t ll;
 
#define endl '\n'
#define int ll
ll mod=1e9+7;
ll mod1=1e9+5;
ll power(ll a,ll b)
{
    if(b==0) return 1;
    else if(b%2==0)
        return power(((((a)%mod)*((a)%mod))%mod),b/2)%mod;
    else return (((a)%mod)*(power(((((a)%mod)*((a)%mod))%mod),b/2)%mod))%mod;
}
inline ll inverse(ll a) {
  a %= mod;
  if (a < 0) a += mod;
  ll b = mod, u = 0, v = 1;
  while (a) {
    ll t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += mod;
  return u;
}
  
  
 //using namespace __gnu_pbds;
 //#define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
//find_by_order(k)  returns iterator to kth element starting from 0;
//order_of_key(k) returns count of elements strictly smaller than k;
//erase,insert same as normal set
// mt19937 mrand(chrono::high_resolution_clock::now().time_since_epoch().count()); for randomized solution
ll fastmod(ll x)
{
    return x<mod?x:x%mod;
}
int32_t main()
{
    IOS

   
    int n,k;
    cin>>n>>k;
    int dp[k+1];
    memset(dp,0,sizeof(dp));
    for(int i=k;i>=1;--i)
    {
        dp[i]=power(k/i,n);
        for(int j=2*i;j<=k;j+=i)
        {
            dp[i]-=dp[j];
            dp[i]+mod;
            dp[i]%=mod;
        }
    }        
    int ans=0;
    for(int i=1;i<=k;i++)
    {
        ans+=dp[i]*i;
        ans%=mod;
    }
    cout<<ans<<endl;

}       

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

#include<bits/stdc++.h>

int main(){
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long N, K;
    cin >> N >> K;
    unsigned long ans{0};
    for(unsigned long i{1}; i <= K; ++i){
        auto t = K / i;
        auto r{1UL}, n{N}, a{t}, v{i};
        while(n){
            if(n & 1)(r *= a) %= MOD;
            (a *= a) %= MOD;
            n >>= 1;
        }
        for(unsigned long j{2}, k{i}; j * j <= k || ((k > 1 && ((v /= k) *= (k - 1))), 0); ++j)if(k % j == 0){
            (v /= j) *= (j - 1);
            while(k % j == 0)k /= j;
        }
        ans += r * v;
    }
    cout << ans % MOD << 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;
typedef long long ll;

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() {
    // 3^45 mod. 1000000007 を計算してみる
    cout << modpow(3, 45, 1000000007) << endl;
}
int main(){
    int n, k;
    cin >> n >> k;
    ll ans = 0;
    vector<ll> gcd(k+1);
    for(int i = k; i >= 1; i--){
        gcd[i] = modpow(k/i, n, 1000000007);
        ans += gcd[i]*i;
        ans = ans%(1000000007);
        for(int j = 2; j*i <= k; j++){
            ans -= gcd[j*i];
            ans = ans%(1000000007);
        }
    }
    cout << ans << endl;
}

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

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXKN 100001

// x^n in mod
ll modpow(ll x, ll n, ll mod){
  if(n==0) return 1;

  if(n%2==0){
    return modpow(x*x%mod, n/2, mod) % mod;
  }else{
    return x * modpow(x, (n-1), mod) % mod;
  }
}

int main(){
  ll n, k;cin>>n>>k;
  rep(i, MAXKN)is_prime[i]=true;
  is_prime[0]=is_prime[1]=false;
  for(int i=2; i<MAXKN; i++){
    for(int j=i*2; j<MAXKN; j+=i)is_prime[j]=false;
  }

  ll result = 0;
  vector<ll> counts(1);
  rep1(a, k) counts.push_back( modpow(k/a, n, MOD) );

  rrep1(a, k){
    for(int i=a*2; i<=k; i+=a) counts[a]=(counts[a]-counts[i]+MOD)%MOD;
    result += a*counts[a];
    result %= MOD;
  }

  cout<<result<<endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'is_prime' was not declared in this scope
   32 |   rep(i, MAXKN)is_prime[i]=true;
      |                ^~~~~~~~
a.cc:33:3: error: 'is_prime' was not declared in this scope
   33 |   is_prime[0]=is_prime[1]=false;
      |   ^~~~~~~~
Language: C

#include<bits/stdc++.h>
// __builtin_ctz : no of trailing zeros
#define ll long long
#define pp pair<ll,ll>
#define mod 1000000007
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define sa(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define scan() int n; cin>>n ; int a[n]; for(int i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
using namespace std;
ll max(ll x, ll y)
{
    return x>y ? x : y;
}
ll min(ll x, ll y)
{
    return x<y ? x : y;
}
void _(ll&a , ll b)
{
    a=(a%mod+b%mod)%mod;
    a=(a+mod)%mod;
}
long long int modulo(long long int a,long long  int b, long long int n){
    long long int  x=1, y=a; 
    while (b > 0) {
        if (b%2 == 1) {
            x = (x*y) % n; // multiplying with base
        }
        y = (y*y) % n; // squaring the base
        b /= 2;
    }
    return x % n;
}
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,k;cin >> n >> k;
    ll dp[k+1];ll ans=0;
    for(ll i=k;i>=1;i--)
    {
      ll g=k/i;
      ll dans=modulo(g,n,mod);
      for(ll j=2*i;j<=k;j+=i)_(dans,-dp[j]);
        _(ans,dans*i);
      dp[i]=dans;
    }
    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


import java.util.*;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        long MOD = (long) 1e9 + 7;

        // gcd{A1, A2, ... AN} = Xとなる数列の個数は？
        long ans = 0;
        long[] count = new long[k + 1];

        for (int i = k; i >= 1; i--) {
            int x = k / i;
            long p = pow(x, n, MOD);
            for (int j = 0; j <= x; j++) {
                p = p - count[i * j] > 0 ? p - count[i * j] : p - count[i * j] + MOD;
            }
            count[i] = p;
        }
        for (int i = 0; i <= k; i++) {
            ans = (ans + count[i] * i % MOD) % MOD;
        }
//        for (int i = k; i >= 1; i--) {
//            long tmp = 1;
//            for (int j = 0; j < n; j++) {
//                tmp = tmp * (k / i) % MOD;
//            }
//            for (int j = 1; j <= k / i; j++) {
//                long x = tmp - count[i * j];
//                tmp = x > 0 ? x % MOD : x + MOD;
//            }
//            count[i] = tmp;
//            ans = (ans +  tmp * i) % MOD;
//        }

        System.out.println(ans);
    }

    int gcd(int m, int n) {
        if (m < n) return gcd(n, m);
        if (n == 0) return m;
        return gcd(n, m % n);
    }

    long pow(int i, int n, long mod) {
        if (n == 0) {
            return 1;
        }
        long tmp = pow(i, n / 2, mod);
        tmp = tmp * tmp % mod;
        if (n % 2 == 1) {
            tmp = tmp * i % mod;
        }
        return tmp;
    }


    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


Compiler output:
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define int long long 
using ldb = long double;
using pa = pair < int, int >;
#define F  first
#define S  second
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 2e5 + 10;
const int LINF = LLONG_MAX;
int modpow(int x, int y){
    int ans=1;
    if(y==1){
        return x%MOD;
    }
    x=x % MOD;
    y=y % (MOD-1);
    while(y>0){
        if(y & 1){
            ans = (ans*x) %MOD;
        }
        x *= x;
        x = x % MOD;
        y >>= 1;
    }
    return ans;
}

int modinv(int x){
    return modpow(x,MOD-2);
}
int sub(int x, int y) {
    x -= y;
    if (x < 0) return x + MOD;
    return x;
}
int add(int x, int y) {
    x += y;
    if (x >= MOD) return x - MOD;
    return x;
}
int multiply(int a,int b){
    return (a*b)%MOD;
}
int ans[N];
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    cin >> n >> k;
    int final = 0;
    for(int i = k;i >=1;i--){
        int ways = k/i;
        ans[i] = modpow(ways,n);
        for(int j = 2;j*i <=k;j++){
            ans[i] = sub(ans[i],ans[i*j]);
        }
        final = add(final,multiply(ans[i],i));
    }
    cout << final << 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

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
const int MOD=1000000007;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;

lint powmod(lint a,lint b){
  return b?powmod(a*a%MOD,b/2)*(b%2?a:1)%MOD:1;
}

int main(void){
    lint N,K;
    cin >> N >> K;
    lint ans[K+1]={};
    for(int i=K;i>=1;i--){
        lint bi=K/i;
        ans[i]=powmod(bi,N);
        for(int j=i*2;j<=K;j+=i) ans[i]=(ans[i]-ans[j]+MOD)%MOD;
    }
    lint sum=0;
    rep(i,K+1) (sum+=ans[i]*i)%=MOD;
    cout << sum << endl;
}

Compiler output:
main.c:2:9: 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 unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1e5+5;
const int M = 1e6;
const ll INF = (ll)(1e18);
const int inf = 1e9;
const ll MOD = 1000000007LL;

ll power_modulo_fast(ll a, ll b) {    // zwraca (a^b) % MOD
	ll i;
	ll result = 1;
	ll x = a%MOD;

	for (i=1; i<=b; i<<=1) {
		x %= MOD;
		if ((b&i) != 0) {
			result *= x;
			result %= MOD;
		}
		x *= x;
	}

	return result;
}

ll get(ll a, ll b, ll d) {
    ll r = b%d;
    b -= r;
    r = a%d;
    if (r != 0) a += d-r;
    if (a > b) return 0LL;

    return (b-a)/d + 1;
}

ll n, k;
ll s[MAX_N];

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

    cin >> n >> k;
    ll ans = 0LL;

    for (ll i = k; i >= 1; i--) {
        ll cnt = get(1LL, k, i);
        //cout << "D: " << i << " " << cnt << "\n";
        s[i] = power_modulo_fast(cnt, n);
        //cout << i << ": " << s[i] << "\n";
    }

    for (ll i = k; i >= 1; i--) {
        for (ll j = i+i; j <= k; j += i) {
            s[i] -= s[j];
            if (s[i] < 0) s[i] += MOD;
        }
    }

    for (ll i = 1LL; i <= k; i++) {
        ll tmp = (s[i] * i) % MOD;
        ans += tmp;
        ans %= MOD;
    }


    cout << ans;



    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, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define ACC(c) (accumulate(ALL(c), 0LL))
#define PRINT(x) cout << (x) << "\n"

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

inline int std_in(int& a) {return scanf("%d", &a);}
auto pint_compare = [](pint x, pint y) -> bool{return (x.first < y.first);};
const int MOD = 1000000007;

ll N, K;
ll g[200010];

ll powll(ll x){
    vector<ll> v;
    v.push_back(x);
    for(ll i = 1; (1 << i) <= N; i++){
        v.push_back(v[i - 1] * v[i - 1] % MOD);
    }
    ll ret = 1;
    for(ll i = 0; (1 << i) <= N; i++){
        if((1 << i) & N) ret = ret * v[i] % MOD;
    }
    return ret;
}


signed main(){
    cin >> N >> K;
    ll ans = 0;
    for(ll i = K; i > 0; i--){
        g[i] = powll(K / i);
        for(ll j = 2; j * i <= K; j++) g[i] = (g[i] - g[j * i] + MOD) % MOD;
        ans = (ans + g[i] * i) % MOD;
    }
    PRINT(ans);
    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>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}
ll ketawa(ll a){ll r=0;while(a){r+=a%10;a/=10;}return r;}

ll calc(ll a,ll b,ll p){//a^(b) mod p   
  if(b==0)return 1;
  ll y = calc(a,b/2,p);y=(y*y)%p;
  if(b & 1) y = (y * a) % p;
  return y;
}


int main(){

  ll n,k,ans=0;
  cin >> n >> k;

  vector<ll> dp(k+1,0);
  //dp[k] = 1;
  FORR(i,1,k+1){
    dp[i] = calc(k/i,n,MOD);
    for(ll j=2*i;j<=k;j+=i){
      (dp[i] += MOD-dp[j]) %= MOD;
    }
    (ans += dp[i]*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++

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

//M^N modMOD
ll modpow(ll M, ll N) {
  if(N==0) return 1;
  else if(N%2==0) return modpow(M, N/2)*modpow(M, N/2)%MOD;
  else return M*modpow(M, N-1)%MOD;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll N, K;
  cin >> N >> K;

  vector<ll> num(K+1);
  for(ll i=1; i<=K; ++i) num[i] = modpow(K/i, N);
  
  for(ll i=K; i>0; --i) {
    set<ll> divisor_sqrt, divisor={1};
    for(ll j=2; j*j<=i; ++j) if(i%j==0) divisor_sqrt.insert(i/j);
    for(ll j: divisor_sqrt) {
      divisor.insert(j);
      divisor.insert(i/j);
    }
    
    for(ll j: divisor) num[j] -= num[i];
  }
  
  for(ll i=1; i<=K; ++i) ans += i*num[i];
  
  cout << ans%MOD << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:26: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |   for(ll i=1; i<=K; ++i) ans += i*num[i];
      |                          ^~~
      |                          abs
a.cc:35:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |   cout << ans%MOD << '\n';
      |           ^~~
      |           abs
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MOD 1000000007
#define all(ppp) ppp.begin(),ppp.end()
#define out(ppp) cout<<(ppp)<<endl
#define out1(ppp) cout<<(ppp) 
#define MAX_CHAR 256

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define pb push_back

typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
typedef vector<vpi> vvpi;

typedef set<pi> spi;

const int INF=INT_MAX;
ll mymod(ll a,ll b){
    a%=MOD;
    ll result=1;
    while(b>0){
        if(b&1){
            result=(result*a)%MOD;
        }
        a=(a*a)%MOD;
        b>>=1;
    }
    return result;
    
}
void solve(){
    ll N,K;
    cin>>N>>K;
    vl cnt(K+1,0);
    ll ans=0;
    for(int i=K;i>0;i--){
        ll temp=mymod(K/i,N);
        cnt[i]=temp;
        for(int j=2*i;j<=K;j+=i){
            cnt[i]+=(MOD-cnt[j]);
        }
        ans=ans+(cnt[i]*i)%MOD;
        ans%=MOD;
    }
    ans=(ans+MOD)%MOD;
    out(ans);
    return ;
}

int main(){
    solve();
    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;

const int N = 3e5 + 9, mod = 1e9 + 7;

template <int32_t MOD>
struct modint {
    int32_t value;
    modint() = default;
    modint(int32_t value_) : value(value_) {}
    inline modint<MOD> operator + (modint<MOD> other) const { int32_t c = this->value + other.value; return modint<MOD>(c >= MOD ? c - MOD : c); }
    inline modint<MOD> operator - (modint<MOD> other) const { int32_t c = this->value - other.value; return modint<MOD>(c <    0 ? c + MOD : c); }
    inline modint<MOD> operator * (modint<MOD> other) const { int32_t c = (int64_t)this->value * other.value % MOD; return modint<MOD>(c < 0 ? c + MOD : c); }
    inline modint<MOD> & operator += (modint<MOD> other) { this->value += other.value; if (this->value >= MOD) this->value -= MOD; return *this; }
    inline modint<MOD> & operator -= (modint<MOD> other) { this->value -= other.value; if (this->value <    0) this->value += MOD; return *this; }
    inline modint<MOD> & operator *= (modint<MOD> other) { this->value = (int64_t)this->value * other.value % MOD; if (this->value < 0) this->value += MOD; return *this; }
    inline modint<MOD> operator - () const { return modint<MOD>(this->value ? MOD - this->value : 0); }
    modint<MOD> pow(uint64_t k) const {
        modint<MOD> x = *this, y = 1;
        for (; k; k >>= 1) {
            if (k & 1) y *= x;
            x *= x;
        }
        return y;
    }
    modint<MOD> inv() const { return pow(MOD - 2); }  // MOD must be a prime
    inline modint<MOD> operator /  (modint<MOD> other) const { return *this *  other.inv(); }
    inline modint<MOD> operator /= (modint<MOD> other)       { return *this *= other.inv(); }
    inline bool operator == (modint<MOD> other) const { return value == other.value; }
    inline bool operator != (modint<MOD> other) const { return value != other.value; }
    inline bool operator < (modint<MOD> other) const { return value < other.value; }
    inline bool operator > (modint<MOD> other) const { return value > other.value; }
};
template <int32_t MOD> modint<MOD> operator * (int64_t value, modint<MOD> n) { return modint<MOD>(value) * n; }
template <int32_t MOD> modint<MOD> operator * (int32_t value, modint<MOD> n) { return modint<MOD>(value % MOD) * n; }
template <int32_t MOD> ostream & operator << (ostream & out, modint<MOD> n) { return out << n.value; }

using mint = modint<mod>;

mint ans[N];
int32_t main() {
    int n, k; cin >> n >> k;
    mint res = 0;
    for(int i = k; i >= 1; i--) {
    	ans[i] = mint(k / i).pow(n);
    	for(int j = i + i; j < N; j += i) ans[i] -= ans[j];
    	res += ans[i] * i;
    }
    cout << res << '\n';
    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

M = 1000000007


def main(N=None, K=None):
    if not N or not K:
        N = int(input())
        K = int(input())
    ans = 0
    gcds = {}
    for X in range(K, 0, -1):
        gcds[X] = int(pow(K//X, N, M))
        n = 1
        while True:
            n += 1
            if n*X > K:
                break
            gcds[X] -= gcds[n*X]
        ans += gcds[X]*X
    ans %= M
    print(ans)
    return ans


if __name__ == "__main__":
    # assert main(3, 2) == 9
    # assert main(3, 200) == 10813692
    # assert main(100000, 100000) == 742202979
    main()


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | M = 1000000007
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
main.c:4:1: error: expected ',' or ';' before 'def'
    4 | def main(N=None, K=None):
      | ^~~
main.c:10:5: error: expected identifier or '(' before 'for'
   10 |     for X in range(K, 0, -1):
      |     ^~~
main.c:25:7: warning: #assert is a deprecated GCC extension [-Wdeprecated]
   25 |     # assert main(3, 2) == 9
      |       ^~~~~~
main.c:25:25: warning: extra tokens at end of #assert directive
   25 |     # assert main(3, 2) == 9
      |                         ^~
main.c:26:7: warning: #assert is a deprecated GCC extension [-Wdeprecated]
   26 |     # assert main(3, 200) == 10813692
      |       ^~~~~~
main.c:26:27: warning: extra tokens at end of #assert directive
   26 |     # assert main(3, 200) == 10813692
      |                           ^~
main.c:27:7: warning: #assert is a deprecated GCC extension [-Wdeprecated]
   27 |     # assert main(100000, 100000) == 742202979
      |       ^~~~~~
main.c:27:35: warning: extra tokens at end of #assert directive
   27 |     # assert main(100000, 100000) == 742202979
      |                                   ^~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

struct mint {
    const int mod = 1e9 + 7;
    long long x;
    
    mint (long long x = 0) : x((x % mod + mod) % mod) {
        
    }
    
    mint& operator=(const long long a) {
        x = a % mod;
        return *this;
    }
    
    mint& operator=(const mint a) {
        x = a.x % mod;
        return *this;
    }
    
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    
    mint& operator-=(const mint a) {
        if ((x += (mod - a.x)) >= mod) x -= mod;
        return *this;
    }
    
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    
    mint inv() const {
        return pow(mod - 2);
    }
    
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

long long mod_pow(long long x, long long n, long long mod = 1e9 + 7) {
    long long ans = 1;
    while(n > 0) {
        if ((n % 2) == 0) {
            x = (x * x) % mod;
            n >>= 1;
        }
        else {
            ans = (ans * x) % mod;
            n--;
        }
    }
    return ans;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, k;
    cin >> n >> k;
    vector<mint> cnt(k + 1, 0);
    mint ans = 0;
    rreps(i, 1, k + 1) {
        mint tmp = mod_pow(k / i, n);
        ll cv = i * 2;
        while(cv <= k) {
            tmp -= cnt[cv];
            cv += i;
        }
        cnt[i] = tmp;
        ans += tmp * i;
    }
    cout << ans.x << 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.