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

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

#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ull unsigned long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 200005
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d\n", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define mod 1000000007
#define MOD 998244353
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(ll N, ll pos){return (bool)(N & (1LL<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

const int N = 100005;
ll cnt[N];

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    FASTIO;
    int n, k;
    cin>>n>>k;
    ll res = 0;
    for(int i = k; i > 0; i--)
    {
        cnt[i] = modPow(k/i, n);
        for(int j = i + i; j < N; j+=i)
            cnt[i] = modSub(cnt[i], cnt[j]);
        res = modAdd(res,modMul(cnt[i], i));
    }
    cout<<res<<endl;

    //End();
    return 0;
}


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>
#define MOD 1000000007
#define MOD2 1000000006
#define TEMPMOD1 998244353
#define TEMPMOD2 998244352
#define INF 1000000000000000007
#define NEGINF -1000000000000000007
#define vll vector<ll> 
#define vvll vector<vector<ll>>
#define pll pair<ll,ll>
#define pii pair<int,int>
#define plll pair<ll,pll>
#define vpll vector<pll>
using namespace std;
typedef long long int ll;

ll mobius[100010];

void initmobius()
{
    for(ll i=1;i<100010;i++)
    {
        mobius[i]=1;
    }
    for(ll i=2;i<100010;i++)
    {
        if(mobius[i]==1)
        {
            for(ll j=i;j<100010;j+=i)
            {
                mobius[j]*=(-i);
            }
            for(ll j=(i*i);j<100010;j+=(i*i))
            {
                mobius[j]=0;
            }
        }
    }
    for(ll i=2;i<100010;i++)
    {
        if(mobius[i]>0)
        {
            mobius[i]=1;
        }
        else if(mobius[i]<0)
        {
            mobius[i]=-1;
        }
    }
    return;
}

ll modexpo(ll base,ll power)
{
    ll result=1;
    while(power)
    {
        if(power&1)
        {
            result=(result*base)%MOD;
        }
        base=(base*base)%MOD;
        power>>=1;
    }
    return result;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    initmobius();
    ll n,k,store;
    cin>>n>>k;
    ll divby[k+1];
    for(ll i=1;i<=k;i++)
    {   
        store=k/i;
        divby[i]=modexpo(store,n);
    }
    for(ll i=1;i<=k;i++)
    {
        for(ll j=2;(j*i)<=k;j++)
        {
            divby[i]+=(mobius[j]*divby[j*i]);
            if(divby[i]>=MOD)
            {
                divby[i]-=MOD;
            }
            else if(divby[i]<0)
            {
                divby[i]+=MOD;
            }
        }
    }
    ll ans=0;
    for(ll i=1;i<=k;i++)
    {
        store=divby[i]*i;
        if(store>=MOD)
        {
            store%=MOD;
        }
        ans+=store;
        if(ans>=MOD)
        {
            ans-=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;
long long divnum = 1E9+7;
long long mypow(int x, int n){
    long long ret=1,p;
    int l=1,p2=1;
    p=x;
    while(1){
        p%=divnum;
        ret%=divnum;
        if(n&p2) ret*=p;
        p*=p;
        p2<<=1;
        if(p2>n) break;
    }
    return ret%divnum;
}
int main(){
    int N,K;
    cin >> N >> K;
    long long ans=0;
    long long a[K]={0};
    long long p;
    for(int i=K; i>0; i--){
        p=1;
        p=mypow(K/i,N);
        for(int j=2; j<=(K/i); j++){
            p-=a[i*j-1];
            p%=divnum;
        }
        a[i-1]=p;
    }
    for(int i=0; i<K; i++){
        ans+=a[i]*(i+1);
        ans%=divnum;
    }
    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;
 
typedef long long int ll;
#define f first
#define s second
 
const int N = 1000*1000 + 10;
const ll mod = 1e9 + 7;
const ll inf = 1e16;

ll g[N];

ll pw(ll x, ll n)
{
	if(n == 0)
		return 1;
	if(n%2 == 0)
		return pw(((x%mod)*(x%mod))%mod, n/2)%mod;
	return ((pw(((x%mod)*(x%mod))%mod, n/2)%mod) * (x%mod)) % mod;

}


 
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);	
 
 
 	int n, k;
 	cin >> n >> k;
 	ll ans = 0;
 	for(int i = k; i >= 1; i--)
 	{
 		g[i] = pw(k/i, n);
 		for(int j = 2*i; j <= k; j += i)
 		{
 			g[i] += mod;
 			g[i] -= g[j];
 			g[i] %= mod;
 		}
 		
 		ans += ((g[i]%mod)*(i%mod))%mod;
 		ans %= mod;
 	}
 	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;

//#pragma GCC optimize "trapv"
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(int i=a; i<b; i++)
#define drep(i,a,b) for(int i=a; i>b; i--)
#define inf 1e+18L
#define mod 1000000007
#define pb push_back
#define vi vector<int>
#define pii pair<int, int>
#define ll long long 
#define fi first
#define se second
const auto pi = 3.14159265359;
const auto e = 2.718281828459;

int numdigits(int x)
{
    return floor(log10(x)) + 1;
}

template<typename T>
T modpower(T x, T y)
{
    T res = 1;
    x %= mod;
    if(x == 0) return 0;
    while(y > 0)
    {
        if(y&1) res = (res*x)%mod;
        y >>= 1;
        x = (x*x)%mod;
    }
    return res;
}

void solve()
{
    ll n, k;
    cin >> n >> k;
    vector<ll> dp(k+1, 0); //dp[i] is the number of sequences with gcd i
    drep(i,k,0)
    {
        ll val = k/i;
        val = modpower(val, n);
        val %= mod;
        for(int j=2*i; j<=k; j+=i)
        {
            val -= dp[j];
        }
        dp[i] = val;
    }
    // for(auto k : dp) cout << k << " ";
    // cout << "\n";
    ll ans = 0;
    rep(i,1,k+1)
    {
        ll var = ((dp[i]%mod)*(i%mod))%mod;
        ans = ((ans%mod) + (var%mod))%mod;
        ans %= mod;
    }
    cout << ans << "\n";
}

int main()
{
    FASTIO
    // int t;
    // cin >> t;
    // while(t--)
        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

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

#define pb push_back
#define fi first
#define SZ(x) (int((x).size()))
#define se second
#define ll long long
#define pq priority_queue
#define MP make_pair
#define pii pair<int,int>
#define mod 1000000007
#define debug(x) cerr<<#x<<"="<<x<<'\n'

int read() {
  int x=0,w=1;
  char ch=0;
  while (ch<'0'||ch>'9') {
    if (ch=='-') w=-1;
    ch=getchar();
  }
  while (ch>='0'&&ch<='9') {
    x=(x<<3)+(x<<1)+(ch-'0');
    ch=getchar();
  }
  return x*w;
}

int p0w(ll base,int p) {
	ll res=1;
	while (p) {
		if (p%2==1) (res*=base)%=mod;
		(base*=base)%=mod;
		p/=2;
	}
	return res;
}

const int maxn=2e5+10;

int n,m;
int dif[maxn];

int main(){
	n=read(),m=read();
	int ans=0;
	for (int i=1;i<=m;i++) {
		int cur=p0w(m/i,n);
		int tmp=0;
		for (int j=1;j*j<=i;j++) {
			if (i%j) continue;
			tmp+=dif[j];
			if (j*j!=i) tmp+=dif[i/j];
		}
		tmp-=dif[i];
		dif[i]=i-tmp;
		ans+=(ll)dif[i]*(ll)cur%mod;
		ans%=mod;
	}
	printf("%d\n",ans);
	return 0;
}


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<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

ll F[2100010];

ll Mul(ll a, ll b) {
	return ((a % mod) * (b % mod)) % mod;
}

void fact(void) {
	F[0] = 1;
	F[1] = 1;
	for (int i = 2; i <= 2100000; i++) {
		F[i] = Mul(i, F[i - 1]);
	}
}
ll square(ll x) {
	return (x * x) % mod;
}

ll power(ll x, ll y) {
	if (y == 0) return 1;
	else if (y == 1) return x % mod;
	else if (y % 2 == 0) return square(power(x, y / 2)) % mod;
	else return square(power(x, y / 2)) * x % mod;
}

ll Div(ll a, ll b) {
	return Mul(a, power(b, mod - 2));
}
ll P(ll n, ll r) {
	if (n < r || n < 0 || r < 0) return 0;
	return Div(F[n], F[n - r]);
}

ll C(ll n, ll r) {
	if (n < r || n < 0 || r < 0) return 0;
	ll ret;
	ret = Div(F[n], Mul(F[n - r], F[r]));
	return ret;
}

ll cnt[100010];
int main()
{
	ll N, K;
	cin >> N >> K;
	ll ans = 0;
	for (int i = K; i >= 1; i--) {
		ll num = power(K / i, N);
		int j = 2;
		while (i * j <= K) {
			num -= cnt[i * j];
			j++;
		}
		cnt[i] = num;
		ans = (ans + i * num) % mod;
	}
	cout << ans << endl;
}


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

#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;
#define f first
#define s second
#define Mp make_pair
#define pb push_back
#define ppb pop_back
#define Lb lower_bound
#define Ub upper_bound
#define all(x) x.begin(), x.end()
#define fast_io ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
const ll Maxn = 1e5+5, N = 1e6+5, Mod = 1e9+7, Inf = 1e18, Log = 22;
ll Power(ll x, ll t){
    if (t == 0){
        return 1;
    }
    return ((t%2 ? x : 1)*Power((x*x)% Mod, t/2))%Mod;
}
ll n, k, dp[Maxn], ans;
int main(){
    fast_io
    cin >> n >> k;
    for (ll i = k; 1 <= i; i--){
        dp[i] = (Power(k/i, n))%Mod;
        for (ll j = 2*i; j <= k; j += i){
            dp[i] -= dp[j];
            dp[i] += Mod;
            dp[i] %= Mod;
        }
        ans += (dp[i]*i)%Mod;
        ans %= Mod;
    }
    cout << ans << '\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

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

ll mpow(ll x, ll n){ //x^n(mod mo) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % mo;
        x = x*x % mo;
        n = n >> 1;
    }
    return ans;
}

int main(){
    ll N,K;
    string S;
    cin >> N >> K;
    vector<ll> d(K+1);
    if(K == 1){
        cout << 1 << endl;
        return 0;
    }

    for(int i = 1;i<=K;i++){
        d[i] = mpow(K/i, N);
        //cout << d[i] << " ";     
    }
    //cout << endl;
    for(int i = K;0 < i;i--){
        for(int j = 2; i*j <= K; j++){
            d[i] -= d[i*j];
        }
    }

    ll ans = 0;
    for(int i = 1;i<=K;i++){
        ans += (d[i]*i) % mo;
        ans %= mo;
    }
    cout << ans << endl;
        /*
        auto v = factorize(i);
        sum += N;7 
        rep(j,v.size()){
            rep(k, v[j].second){
                sum += ((i / pow(v[j].first, k+1)))*v[j].first;
            }
        }
    }
    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

//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/rope>
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pair<ll,ll> >   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pair<int,int> >   vpi;
typedef    vector<pair<double,double> >   vpd;
typedef    pair<double,double>   pd;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define all(x) x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(10)<<fixed
const    ld   PI=3.14159265359;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}



int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{
ll n,k;
cin>>n>>k;
ll dp[k+1]={0};

ll an=0;
ll pot[k+1]={0};
for(ll i=1;i<=k;i++)
pot[i]=modpow(i,n);

/*for(int i=1;i<=k;i++)
cout<<pot[i]<<" ";
cout<<"\n";
*/

for(ll i=k;i>=1;i--)
{
	ll po=pot[k/i];
	ll ans=0;
	ans=madd(ans,po);
	
	
	
	for(ll j=i+i;j<=k;j+=i)
	ans=msub(ans,dp[j]);
	
	dp[i]=ans;
	an=madd(an,mmul(i,ans));
}

cout<<an;

}return 0;}

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;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).end()
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; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

ll mod_pow(ll n, ll p, ll mod=MOD) {
    if(p==0) return 1;
    ll res = mod_pow(n*n%mod, p/2, mod);
    if(p%2==1) res = res * n % mod;
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
	int n, k;
	cin >> n >> k;
    vector<ll> d(k+1);
    for (int i = 1; i <= k; i++) {
        d[i] = mod_pow(k/i, n, MOD);
    }
    for (int i = k; i > 0; i--) {
        for (int j = 2*i; j <= k; j+=i) {
            d[i] -= d[j];
            d[i] %= MOD;
        }        
    }
    ll ans = 0;
    for (int i = 1; i <= k; i++) {
        ans += d[i] * i;
        ans %= MOD;
    }
	cout << ans << "\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

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

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}

int main() {
    ll N,K;
    cin >> N >> K;
    vector<ll>d(K);

    d[K-1]=1;
   
    for(ll i=K; i>0; i--){
         ll sum=0;
        for(ll j=2*i; j<K/i+1; j+=i){
            
        
         sum+=d[j-1];}
    ll z=std::pow(K/i,N);
    d[i-1]=z-sum;
    }
ll ans=0;
    rep(i,K){
ans+= d[i]*(i+1);
    }

    cout<<ans%mod <<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>
#include <boost/multiprecision/cpp_int.hpp>
using bint = boost::multiprecision::cpp_int;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const ll MAX = ll(1e9) + 7;

ll modpow(ll a, ll n, ll mod) {
    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;
    ll ans = 0;
    vector<ll> cnt(K+1);
    for(int i = K; i > 0; i--) {
        cnt[i] = modpow(ll(K/i), ll(N), MAX);
        repSE(j,2,K/i+1) {
            cnt[i] = (cnt[i] - cnt[j*i]) % MAX;
        }
        ans = (ans + ll(cnt[i] * i)) % MAX;
    }
    if (ans < 0) ans += MAX;
    cout << ans << endl;
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define mod 1000000007
lli n,k;

lli power(lli x,lli n)
{
    lli res=1;
    while(n>0)
    {
        if(n%2==0)
        {
            res=(res*x%mod;
        }
        x=(x*x)%mod;
        n=n/2;
    }
    return res%mod;
}
lli solve()
{
    lli dp[k+1];
    for(lli g=k;g>=1;g--)
    {
        lli tm=power(k/g,n);
        
        for(int j=2*g; j<=k ;j+=gd)
        {
            extrs= (extra + dp[j])%mod;
        }
        dp[g]=(temp - extra  +mod )%mod;
    }
    
    cout<<dp[n]<<"\n";

}
int main()
{
    cin>>n>>k;
    solve()
    return 0;
}


Compiler output:
a.cc: In function 'long long int power(long long int, long long int)':
a.cc:14:27: error: expected ')' before ';' token
   14 |             res=(res*x%mod;
      |                 ~         ^
a.cc: In function 'long long int solve()':
a.cc:28:33: error: 'gd' was not declared in this scope; did you mean 'g'?
   28 |         for(int j=2*g; j<=k ;j+=gd)
      |                                 ^~
      |                                 g
a.cc:30:13: error: 'extrs' was not declared in this scope; did you mean 'extern'?
   30 |             extrs= (extra + dp[j])%mod;
      |             ^~~~~
      |             extern
a.cc:30:21: error: 'extra' was not declared in this scope; did you mean 'extern'?
   30 |             extrs= (extra + dp[j])%mod;
      |                     ^~~~~
      |                     extern
a.cc:32:16: error: 'temp' was not declared in this scope; did you mean 'tm'?
   32 |         dp[g]=(temp - extra  +mod )%mod;
      |                ^~~~
      |                tm
a.cc:32:23: error: 'extra' was not declared in this scope; did you mean 'extern'?
   32 |         dp[g]=(temp - extra  +mod )%mod;
      |                       ^~~~~
      |                       extern
a.cc:37:1: warning: no return statement in function returning non-void [-Wreturn-type]
   37 | }
      | ^
a.cc: In function 'int main()':
a.cc:41:12: error: expected ';' before 'return'
   41 |     solve()
      |            ^
      |            ;
   42 |     return 0;
      |     ~~~~~~
Language: C

//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define pb  push_back
#define mp make_pair
#define ll long long
#define pr pair<int, int> 
#define vpr vector<pr> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define all(n) n.begin(),n.end()
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define Test printf("Case %d: ",tc++);
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
const int mod = (int)1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;


int fastExpo(int a,int b){
	int res = 1;
	a%=mod;
	while(b){
		if(b&1) res = (res*a)%mod;
		a*=a;
		a%=mod;
		b>>=1;
	}
	return res;
}

int sumOfGCD(int n,int k){
	int cnt[k+1] = {0};
	for(int g = k;g>=1;g--){
		int cnt_mul = k/g;
		int tmp;
		tmp = fastExpo(cnt_mul,n);
		tmp%=mod;
		int extra = 0;
		for(int j = g*2;j<=k;j+=g){
			extra = (extra +cnt[j]);
			extra%=mod;
		}

		cnt[g] = (tmp - extra + mod);
		cnt[g] %= mod;
	}
	int sum = 0;
	int add;
	for(int i=1;i<=k;i++){
		add = ((cnt[i]%mod) * (i% mod));
		add %= mod;
		sum += add;
		sum %= mod;
	}

	return sum;
}

int solve() 
{
	//happy coding

	int n,k;
	cin>>n>>k;
	cout<<sumOfGCD(n,k)<<endl;

	return 0;
}
int main(){
	int test = 1;
	//scanf("%d", &test);
	while (test--)solve();return 0;
}

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

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

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

ll rep_power_modM(ll a, ll n, ll M){
    if(n == 0LL)return 1LL;
    if(n%2 == 0LL){ll tmp = rep_power_modM(a,n/2,M); return tmp*tmp%M;}
    return a*rep_power_modM(a,n-1LL,M)%M;
}

int main(){
	int N,K;
	cin>>N>>K;
	vector<ll> e_ans(K+1, 0);
	for(int i = K; i>= 1; --i){
		ll t = rep_power_modM(K/i, N, MOD);
		for(int j = 2; i*j<=K; ++j){
			t -= e_ans[i*j];
			if(t < 0) t+=MOD;
		}
		e_ans[i] = t % MOD;
	}
	ll ans = 0LL;
	REP(i,K){
		ans += (e_ans[i]*i)%MOD;
	}
	cout<<ans%MOD<<endl;
}

// int main(){
// 	ll N,K; cin>>N>>K;
// 	int ans = 0;
// 	int cnt = 0;
// 	for(int i = 2; i<=K; ++i){
// 		ll t = rep_power_modM(K/i, N, MOD);
// 		ans += (t*i)%MOD;
// 		cnt += t%MOD;
// 		int div = 0;
// 		for(int j = 1; j*j<=i; ++j){
// 			if(i%j != 0)continue;
// 			if(j*j == i){div ++; ans -= j*t; continue;}
// 			else div += 2;
// 			int oth = i/j;
// 			if(j != 1)ans -= t*j;
// 			if(oth != i)ans -= t+i;
// 		}
// 		div -= 2;
// 		cnt -= div;
// 		ans %= MOD;
// 		cnt %= MOD;
// 	}
// 	printf("[ans]=>%d [cnt]=>%d\n", ans, cnt);
// 	ans += (rep_power_modM(K,N,MOD)-cnt)%MOD;
// 	cout<<ans<<endl;
// 	return 0;
// }

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

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define ll long long
const int MOD = 1e9 + 7;
const int maxn = 1e5 + 5;
ll ans[maxn];

ll qpow(ll a, ll b){
    ll res = 1;
    while(b ){
        if(b & 1) res = (res% MOD * a % MOD) %MOD;
        a = (a % MOD * a % MOD)%MOD;
        b >>= 1;
    }
    return res;
}

int main()
{
    long long  n,k;
    scanf("%lld%lld",&n,&k);
    for(long long  i = k; i >=1; i--){
        ans[i] = qpow(k/i,n);
        for(long long j = 2 *i; j <= k; j = j + i){
            ans[i] = (ans[i] - ans[j] + MOD)%MOD;
        }

    }
    ll res = 0;
    for(long long  i = 1; i <= k; i++){
            res = (res + i *ans[i])%MOD;
    }
    printf("%lld",res);
    return 0;




    return 0;
}


Compiler output:
main.c:7:4: error: variably modified 'ans' at file scope
    7 | ll ans[maxn];
      |    ^~~
Language: C

#include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second

using namespace std;

class DebugStream {}LOG;
template <typename T>DebugStream &operator<<(DebugStream &s, const T&) { return s; }
#ifdef DEBUG
#define LOG clog
#endif

typedef long long ll;
typedef pair<ll, ll> ii;
typedef long double ld;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int maxN = 1e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20, bs = 29;

ll fastPow(ll a, ll b) {
	ll ret = 1;
	while(b) {
		if(b & 1) ret = ret * a % MOD;
		b >>= 1, a = a * a % MOD;
	}
	return ret;
}

ll ans[maxN];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	ll n, k;
	cin >> n >> k;

	ll sm = 0;
	for(int i = k; i > 0; i--) {
		ans[i] = fastPow(k / i, n);
		for(int j = i * 2; j <= k; j += i)
			ans[i] = (ans[i] + MOD - ans[j]) % MOD;
		sm = (sm + ans[i] * i) % MOD;
	}
	cout << sm << '\n';
}


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;
const int N=1e5+10;
const int MOD=1e9+7;
typedef long long ll;
ll qpow(ll a,ll b){
    ll ans=1;
    while(b){
        if(b%2){
            ans=ans*a%MOD;
        }
        b/=2;
        a=a*a%MOD;
    }
    return ans;
}
ll f[N];
int main()
{
    //cout<<qpow(2,4);
    ll n,k;
    cin >>n>>k;
    ll ans=0;
    for(int i=k;i>=1;i--){
            f[i]=qpow(k/i,n);
        for(int j=i*2;j<=k;j+=i){
            f[i]=(f[i]-f[j])%MOD;
        }
        ans=(ans+i*f[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 int MAXN = 100 * 1000 + 10;
const ll md = 1e9 + 7;
ll k, n, dp[MAXN], ans = 0;

ll pw(ll a, ll b)
{
	if(b == (ll)0)
		return (ll)1;
	if(b % 2 == 0)
		return ((pw(a, b / 2)) * (pw(a, b / 2))) % md;
	return ((((pw(a, b / 2)) * (pw(a, b / 2))) % md) * a) % md;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> k;
	for(ll x = k; x >= 1; x--)
	{
//		cout << "x " << x << endl;
		dp[x] = pw((k / x), n);
		for(ll y = 2 * x; y <= k; y += x)
		{
			dp[x] -= dp[y];
			dp[x] %= md;
		}
	}
	for(ll x = 1; x <= k; x++)
	{
		ll y = x * dp[x];
		y %= md;
		ans += y;
		ans %= md;
	}
	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;
typedef long long int ll;

const int MAXN = 100 * 1000 + 10;
const ll md = 1e9 + 7;
ll k, n, dp[MAXN], ans = 0;

ll pw(ll a, ll b)
{
	if(b == (ll)0)
		return (ll)1;
	if(b % 2 == 0)
		return ((pw(a, b / 2)) * (pw(a, b / 2))) % md;
	return ((((pw(a, b / 2)) * (pw(a, b / 2))) % md) * a) % md;
}

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> k;
	for(ll x = k; x >= 1; x--)
	{
		cout << "x " << x << endl;
		dp[x] = pw((k / x), n);
		for(ll y = 2 * x; y <= k; y += x)
		{
			dp[x] -= dp[y];
			dp[x] %= md;
		}
	}
	for(ll x = 1; x <= k; x++)
	{
		ll y = x * dp[x];
		y %= md;
		ans += y;
		ans %= md;
	}
	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>
#define pb push_back
using namespace std;
long long n,k,cnt[100005],dp[100005],ans;
const long long mod = 1000000007;
long long exp(long long a , long long b){
    if(b==0)return 1;
    long long tmp = (exp(a,b/2));
    if(b%2==0)return (tmp*tmp)%mod;
    return (a*((tmp*tmp)%mod))%mod;
}

int main(){
    cin>>n>>k;
    for(int i =1;i<=k;i++){
        cnt[i]=1;
        for(int j =2*i;j<=k;j+=i)cnt[i]++;
    }
    // cout<<cnt[1]<<endl;
    for(int i =1;i<=k;i++){

        dp[i]=exp(cnt[i],n);
        // cout<<dp[i]<<endl;
    }
    for(int i =k;i>0;i--){
        for(int j = i*2;j<=k;j+=i){
            dp[i]= (dp[i]+mod-dp[j])%mod;
        }
        ans= (ans+ ((dp[i]*i)%mod))%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 ll;
#define REP(i,b,n) for(int i=b;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define all(obj) (obj).begin(),(obj).end()
const int mod = 1e9+7;
ll cnt[100005];

ll pp(ll i,ll j){
    ll res=1;
    while(j>0){
        if(j&1)res=res*i%mod;
        i=i*i%mod;
        j>>=1;
    }
    return res;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,k;
    cin>>n>>k;
    rep(i,k)cnt[i]=0;
    for(int i=k;i>0;i--){
        ll t=k/i;
        cnt[i]=pp(t,n);
        int ii=i*2;
        while(ii<=k){
            cnt[i]-=cnt[ii];
            ii+=i;
        }
    }
    ll ans=0;
    for(int i=1;i<=k;i++){
        ans+=i*cnt[i];
        ans%=mod;
    }
    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>
#define ll long long
using namespace std;

ll mpower(ll a,ll b,ll c){
  int z;
  if(b==0){
    z=1;
    z%=c;
    return z;
  }
  if(b==1){
    z=a;
    z%=c;
    return z;
  }
  else{
    return (((mpower(a,b/2,c))*(mpower(a,b/2,c))%c)*mpower(a,b%2,c)%c);
  }
}

int main() {
  int n,k;
  cin>>n>>k;
  ll mod=1e9+7;
  ll vec[k+1];
  for(int i=k;i>0;i--){
    vec[i]=mpower(k/i,n,mod);
    for(int j=2;j<n+10;j++){
      if(i*j>k){
        break;
      }
      vec[i]-=vec[i*j];
    }
  }
  ll ans=0;
  for(int i=1;i<=k;i++){
    ans+=i*vec[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>

using namespace std;

typedef long long int ll;

const ll mod = 1e9 + 7;

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

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

  ll n, k;
  cin >> n >> k;

  vector < ll > gcd(k + 1);
  for(int i = 1; i <= k; i++){
    gcd[i] = pwr(k / i, n);
  }
  for(int i = k; i >= 1; i--){
    for(int j = 2 * i; j <= k; j += i) gcd[i] = (gcd[i] - gcd[j] + mod) % mod;
  }

  ll ans = 0;
  for(int i = 1; i <= k; i++){
    ans = (ans + gcd[i] * i) % mod;
  }

  cout << ans << '\n';
}


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;
long long n,k,m=1e9+7,ans,i,q,a[100000009],ans1,ans3,s;
long p,long long q)
{
	if(q==1) return p;
	long long w=axar(p,q/2);
	if(q%2==1)
	{
		return ((w*w)%m*p)%m;
	}
	if(q%2==0)
	{
		return (w*w)%m;
	}
}
int main()
{
	cin>>n>>k;
	for(i=k;i>=1;i--)
	{
		q=i;
		
		while(q<=k)
		{
			ans1+=a[q]%m;
			q+=i;
			ans1=(ans1+m)%m;
		}
		a[i]=(axar(k/i,n)-ans1)%m;
		ans1=0;
		a[i]=(a[i]+m)%m;
	}
	for(i=1;i<=k;i++)
	{
		ans3+=i*a[i]%m;
		ans3=(ans3+m)%m;
	}
	cout<<ans3;
}

Compiler output:
a.cc:4:8: error: expected unqualified-id before 'long'
    4 | long p,long long q)
      |        ^~~~
a.cc: In function 'int main()':
a.cc:30:23: error: 'axar' was not declared in this scope
   30 |                 a[i]=(axar(k/i,n)-ans1)%m;
      |                       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int p=1e9+7,c,i,mx,k,k1,a[100001];
int ax(int n)
{
	if(n==1)
	return c;
	long long l=ax(n/2);
	if(n%2==0)
	return l*l%p;
	
	return l*l*c%p;
}
main(){
	int n;
	ios::sync_with_stdio(0);
	cin>>n>>k;
	k1=k;
	for(k1=k;k1>0;k1--)
	{
		if(k/k1==1)
		{
			a[k1]=1;
			continue;
		}
		c=k/k1;
		a[k1]=ax(n);
		for(i=2;i<=c;i++)
		{
			a[k1]-=a[k];
		}2
	}
	for(i=1;i<=k;i++)
	{
		mx+=a[i]*i%p;
	}
	cout<<mx;
}


Compiler output:
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   14 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:31:19: error: expected ';' before '}' token
   31 |                 }2
      |                   ^
      |                   ;
   32 |         }
      |         ~
Language: C

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

#define ll long long 
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(x) (x).begin(), (x).end()

ll add(ll x, ll y) {
	x += y;
	if(x >= MOD) return x - MOD;
	return x;
}
ll sub(ll x, ll y) {
	x -= y;
	if(x < 0) return x + MOD;
	return x;
}
ll mult(ll x, ll y) {
	return (x * y) % MOD;
}
ll bin_pow(ll x, ll y) {
	if(y == 0) return 1;
	if(y == 1) return x;
	if(y & 1) return mult(bin_pow(x, y - 1), x);
	return bin_pow(mult(x, x), y / 2);
}

int main(){

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(0); cin.tie(0);
	ll n, k; cin >> n >> k;
	ll ans[k + 1];
	for(int i = 1; i <= k; i++) {
		ans[i] = bin_pow(k / i, n);
	}
	for(int i = k; i >= 1; i--) {
		for(int j = 2 * i; j <= k; j += i) {
			ans[i] = sub(ans[i], ans[j]);
		}
	}
	ll Ans = 0, sum = 0;
	for(int i = 1; i <= k; i++) {
		sum = add(sum, ans[i]);
		Ans = add(Ans, mult(ans[i], i));
	}
	//cout << sum << "\n";
	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>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

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

int main() {
	int n, k; cin >> n >> k;
	VI s(k+1,0);
	ll ans=0;
	for(int i=k;i>=1;i--){
		int p=k/i;
		s[i]=power(p,n);
		for(int j=2;i*j<=k;j++){
			s[i]-=s[i*j];
			s[i]+=MOD;
			s[i]%=MOD;
		}
		ans+=(s[i]*i)%MOD;
		ans%=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 <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod = 1000000007;

int gcd(ll x, ll y) {
  ll M = max(x, y);
  ll m = min(x, y);
  while (M%m!=0) {
    ll p = M % m;
    M = m;
    m = p;
  }
  return m;
}

ll r(ll x, ll y) {
  if (y == 0) return 1;
  else if (y % 2 == 0) return r(x, y/2) * r(x, y/2) % mod;
  else return x * r(x, (y-1)/2) % mod * r(x, (y-1)/2) % mod;
}

int main() {
  ll n, k;
  cin >> n >> k;
  vector<ll> list(k+1);
  ll sum = 0;
  ll t = 1;
  ll cc = 1;
  ll c = 1;
  for (int i = k; i >0; i--) {
    if (t != k / i) {
      t = k / i;
      cc = r(t, n) % mod;
      c = cc;
    }
    else {
      c = cc;
    }
    ll ii = 2 * i;
    while (ii <= k) {
      c -= list[ii];
      c %= mod;
      ii += i;
    }
    list[i] = c;
    c *= i % mod;
    sum += c;
    sum %= mod;
  }
  if (sum < 0) {
    sum += mod;
  }
  printf("%lld\n", sum);
} 

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;
using ll = long long;
using pll = pair<ll,ll>;
using pii = pair<int,int>;
#define ALL(x) (x).begin(),(x).end()
const ll MOD = 1e9+7;

/*
 * 方針
 * 1 <= X <= Kについて, 最大公約数がXとなるgcd(A1,...,AN) = Xの組を求める
 * このとき, A1,..,ANが皆Xの倍数になればいいが, aXの倍数(a >= 2)にはなってはいけない
 */

ll mod(ll a) {
	return ((a %= MOD) >= 0) ? a : a + MOD;
}

ll modPow(ll a, ll b) {
	ll res = 1;
	while(b > 0) {
		if(b & 1) res = res * a % MOD;
		if(res==0) res = MOD;
		a = a * a % MOD;
		if(a==0) a = MOD;
		b >>= 1;
	}
	return res;
}


int main(){
	ll N, K;
	cin >> N >> K;
	vector<ll> count(K+1, 0);

	ll ans = 0;
	for(int i=K;i>=1;i--) {
		count[i] = modPow(K / i, N);
		for(int j=2*i;j<=K;j+=i) {
			count[i] = mod(count[i] - count[j]);
		}
		ans = mod(ans + i * count[i]);
	}
	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;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
 
void mul(ll &x, ll y){
	x *= y;
	if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}


ll a[N], res;
void solve(){
	int n, k;
	cin >> n >> k;
	for(int i = k; i >= 1; --i){
		ll tmp = bp(k / i, n);
		for(ll j = i * 2; j <= k; j += i){
			tmp -= a[j];
			tmp += mod;
			tmp %= mod;
		}
		a[i] = tmp;
		res += tmp * i;
	}
	cout << res;
}


 
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    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;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
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; }
const ll INF = 1LL << 60;

//auto mod int

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  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++() {
      if ((x++) >= mod) x-= mod;
      return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator--() {
      if ((x += mod-1) >= mod) x-= mod;
      return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  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;
  }
};

int main(){
    int n,k;
    cin >> n >> k;
    map<int,mint> mp;
    mint ans = 0;
    for(int i=k; i>=1; i--){
        mint now = k / i;
        now = now.pow(n);
        for(int j=2*i; j<=k; j+=i){
            now -= mp[j];
        }
        mp[i] = now;
        ans += now * i;
    }

    cout << ans.x << 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;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 105
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 100005;
const int MOD = 1000000007;
ll dp[MAX];
int modPow(long long a, long long n) {
  if (n == 1) return a % MOD;
  if (n % 2 == 1) return (a * modPow(a, n - 1)) % MOD;
  long long t = modPow(a, n / 2);
  return (t * t) % MOD;
}
int main(){
    int n,k;
    cin>>n>>k;
    for(int i=k;i>=1;i--){
        ll tmp=modPow((k/i),n);
        for(int j=2;(ll)j*i<=(ll)k;j++){
            tmp-=dp[j*i];
            if(tmp<0)tmp+=MOD;
            tmp%=MOD;
        }
        dp[i]=tmp;
    }
    ll ans=0;
    for(int i=1;i<=k;i++){
        ans+=(i*dp[i])%MOD;
        ans%=MOD;
    }
    OUT(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;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long

const int mod=1e9+7;

int modPow(int x,int p){
    if(p==1) return x%mod;
    if(p%2==1) return x*modPow(x,p-1)%mod;
    if(p%2==0) return modPow(x,p/2)*modPow(x,p/2)%mod;
}

signed main(){
    int N,K;
    cin>>N>>K;
    int A=0;
    vector<int>ans(K,0);
    for(int i=K;i>=1;i--){
        int a=K/i;
        if(a==1) ans[i−1]++;
        else{
            ans[i-1]+=modPow(a,N);
            for(int j=2;j<=a;j++){
                ans[i-1]-=ans[j*i-1];
              	while(ans[i-1]<0) ans[i-1]+=mod;
            }
        }
      	A+=ans[i-1]*i%mod;
    }
  	A=A%mod;
  	if(A<0) A+=mod;
    cout<<A<<endl;
}


Compiler output:
a.cc:22:22: error: extended character − is not valid in an identifier
   22 |         if(a==1) ans[i−1]++;
      |                      ^
a.cc: In function 'int main()':
a.cc:22:22: error: 'i\U000022121' was not declared in this scope
   22 |         if(a==1) ans[i−1]++;
      |                      ^~~
a.cc: In function 'long long int modPow(long long int, long long int)':
a.cc:13:1: warning: control reaches end of non-void function [-Wreturn-type]
   13 | }
      | ^
Language: C

//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
ll power(ll x,ll y){
	ll re=1;
	while(y>0){
		if(y%2)re=re*x%hell;
		x=x*x%hell;
		y=y/2;
	}
	return re;
}
int main(){
	ll n,k;cin>>n>>k;
	ll dp[k+1]={0};
	for(ll i=k;i>=1;i--){
		ll x=k/i;
		dp[i]=power(x,n);
		for(ll j=2*i;j<=k;j+=i){
			dp[i]=(dp[i]-dp[j]+hell)%hell;
		}
	}
	ll sum=0;
	for(ll i=1;i<=k;i++){
		//cout<<dp[i]<<" ";
		sum=(i*dp[i]%hell+sum)%hell;
	}
	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.