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

#include <bits/stdc++.h>
#define VI vector<int>
#define VVI vector<vector<int>>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 1e18
#define All(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

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;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  ll cnt = modpow(K,N,MOD)-modpow(K-1,N,MOD);
  while(cnt<0)
    cnt += MOD;
  cout << cnt << endl;
  for (int i = 2; i <= K;i++){
    vector<ll> d=divisor(i);
    for (int j = 0; j < d.size();j++) {
      if(d[j]==1)
        continue;
      
      cnt += modpow(k, N, MOD) * d[j];
      cnt %= MOD;
    }
  }

    cout << cnt << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:21: error: 'k' was not declared in this scope
   46 |       cnt += modpow(k, N, MOD) * d[j];
      |                     ^
Language: Java

import java.util.*;
public class Main {
	
    public static long gcd(long x,long y){
        if(x < y) return gcd(y, x);
        if(y == 0) return x;
        return gcd(y, x % y);
    }
  
    public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
        int n = sc.nextInt();
        long ans = 1;
        long mod = 1e9+7;
        for(int i=0;i<n;i++){ans*=k;ans%=mod;      
                            }        
		System.out.println(ans);
	}
}


Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from double to long
        long mod = 1e9+7;
                      ^
1 error
Language: C

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

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using Tuple = tuple<int, int, int>;

ll modnum = 1e9+7;

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


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

    vector<ll> count(k+10, 0);
    for(ll i=k; i > 0; i--) {
        ll num = k/i;
        ll tmp = modpow(num, n, modnum);
        count[i] = tmp;
        ll ii = i*2;
        while(ii <= k) {
            count[i] -= count[ii];
            ii += i;
        }
    }


    EFOR(i,1, k) {
        ans += i*count[i]%modnum;
        ans %= modnum;
    }



    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<stdio.h>
#include<algorithm>
#include<math.h>
#include<string.h>
#define ll long long
using namespace std;
const int maxn=1e5;
const ll mod=1e9+7;
bool check[maxn+10];
int prime[maxn+10];
int mu[maxn+10];
ll sum[maxn+10];
int n,k;
void mo()
{
    memset(check,0,sizeof(check));
    mu[1]=1;
    int tot=0;
    for(int i=2;i<=maxn;i++)
    {
        if(!check[i]){prime[tot++]=i;mu[i]=-1;}
        for(int j=0;j<tot;j++)
        {
            if(i*prime[j]>maxn) break;
            check[i*prime[j]]=1;
            if(i%prime[j]==0)
            {
                mu[i*prime[j]]=0;break;
            }
            else
                mu[i*prime[j]]=-mu[i];
        }
    }
    for(int i=1;i<=maxn;i++)
        sum[i]=(sum[i-1]+mu[i])%mod;
}
ll fpow(ll a,ll b)
{
    ll ans=1;
    while(b)
    {
        if(b&1) ans=ans*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}
int main()
{
    scanf("%d%d",&n,&k);
    mo();
    ll ans=0;
    for(int i=1;i<=k;i++)
    {
        ll res=0;
        for(int j=1;j<=k/i;j++)
            res=(res+mu[j]*fpow(k/i/j,n)%mod)%mod;
        ans=(ans+res*i%mod)%mod;
    }
    printf("%lld\n",ans);
}


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

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

int k, n, vis[100010] = {0};
vector<int> pri;
long long ans = 0;
const int M = 1e9 + 7;
int main() {
    cin >> k >> n;
    int m = sqrt(n + 0.5);
    memset(vis, 0, sizeof(vis));
    for(int i = 2; i <= m; i++) if(!vis[i])
        for(int j = i * i; j <= n; j += i) vis[j] = 1;
    for(int i = 1; i <= n; i++) if(!vis[i]) pri.push_back(i);
    for(int i = 1; i <= n; i++) {
        int l = 0, r = pri.size() - 1;
        while(l <= r) {
            int m = (l + r) >> 1;
            if(pri[m] * i > n) r = m - 1;
            else l = m + 1;
        }
        r++;
        long long s = 1, j = k;
        for(; j > 0; j >>= 1, r = r * r % M)
            if(j & 1) s = s * r % M;
        ans = (ans + s * i) % M;
    }
    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

#include "bits/stdc++.h"

#define MOD 1000000007LL
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<int, int> P;
struct Edge{ll from, to, cost;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

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;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

ll fact[100100];
ll factinv[100100];

bool setfact(){
  fact[0]=1;
  factinv[0]=1;
  for(int i=1;i<100100;i++){
    fact[i] = mod(i*fact[i-1], MOD);
    factinv[i] = modinv(fact[i], MOD);
  }
}

ll comb(ll n, ll k){
  ll tmp = mod(fact[n]*factinv[k], MOD);
  return mod(tmp * factinv[n-k], MOD);
}
/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll N, K;
  cin >> N >> K;
  ll ans = 0;
  ll num = 0;

  for(ll i=2;i<=K;i++){
    ll tmp = K/i;
    //cout << i << " " << tmp << endl;
    ll a=modpow(tmp, N, MOD);
    ll b=modpow(tmp-1, N, MOD);
    num=mod(num+a,MOD);
    num=mod(num-b,MOD);
    ll a2 = mod(i*a, MOD);
    ll b2 = mod(i*b, MOD);
    ans=mod(ans+a2, MOD);
    ans=mod(ans-b2, MOD);
  }
  ans =mod(ans + modpow(K, N, MOD), MOD);
  ans =mod(ans - num, 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>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long int ll;
typedef pair<int, int> P;

const long long int MOD = 1000000007;

long long int mpow(long long int x, int n)
{
    if(n == 0)
        return 1;

    long long int k = 1;
    while(n > 1)
    {
        if(n % 2 == 1)
        {
            k *= x;
            k %= MOD;
        }
        x *= x;
        x %= MOD;
        n /= 2;

    }
    return (k * x) % MOD;
}

int n, k;
ll memo[101010];

ll rec(int m)
{
    if(memo[m] != 0) return memo[m];

    ll ret = mpow(m, n);
    for(int i = 2; i <= m; i++)
    {
        ret = (MOD + ret - rec(m / i)) % MOD;
        //ret -= rec(m / i);
    }
    
    memo[m] = ret;
    return ret;
}

int main()
{
    cin >> n >> k;
    memo[1] = 1;
    ll res = 0;
    for(int i = k; i >= 1; i--)
    {
        res += (i * rec(k / i)) % MOD;
        res %= MOD;
    }
    cout << res << 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 signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll mo=1000000007;
int N,K;
ll dp[101010];

ll modpow(ll a, ll n = mo-2) {
	ll r=1;a%=mo;
	while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1;
	return r;
}


void solve() {
	int i,j,k,l,r,x,y; string s;
	
	
	
	cin>>N>>K;
	ll sum=0;
	for(i=K;i>=1;i--) {
		dp[i]=modpow(K/i,N);
		for(j=i*2;j<=K;j+=i) dp[i]-=dp[j];
		dp[i]=(dp[i]%mo+mo)%mo;
		sum+=i*dp[i]%mo;
	}
	cout<<sum%mo<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); 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;
typedef long long ll;

const ll mod=1000000007;
ll n;
vector<ll> primes;
ll x=0;

ll fpow(ll b,ll e)
{
    ll res=1;
    while(e)
    {
        if(e&1) res=(res*b)%mod;
        b=(b*b)%mod;
        e/=2;
    }
    return res;
}

void solve(int idx,int cnt,ll now,ll lim)
{
    if((cnt%2)==0) x=(x+fpow(lim/now,n))%mod;
    else x=(x-fpow(lim/now,n)+mod)%mod;
    for(int i=idx+1;i<(int)primes.size();i++)
    {
        if(now*primes[i]<=lim) solve(i,cnt+1,now*primes[i],lim);
        else break;
    }
}

int main()
{
    ll k;
    cin >> n >> k;
    vector<bool> sieve(k+1,1);
    for(ll o=2;o<=k;o++)
    {
        if(sieve[o]==0) continue;
        primes.push_back(o);
        for(ll i=o*o;i<=k;i+=o) sieve[i]=0;
    }
    ll res=0;
    for(ll i=1;i<=k;i++)
    {
        x=0;
        solve(-1,0,1,k/i);
        res=(res+i*x)%mod;
    }
    cout << res << 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;

int mod = 1e9 + 7;

int powM(int n, int p) { return (!p ? 1 : (p & 1) ? (1ll * n * powM(n, p - 1)) % mod : powM((1ll * n * n) % mod, p / 2)); }

int add(int a, int b) { return a + b - (a + b >= mod) * mod; }

int sub(int a, int b) { return a - b + (a - b < 0) * mod; }

int mul(int a, int b) { return (1ll * a * b) % mod; }

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

    int n, k;
    cin >> n >> k;
    int g[k + 1] = {}, ans = 0;

    for (int i = k; i >= 1; i--) {
        g[i] = powM(k / i, n);
        for (int j = i + i; j <= k; j += i)
            g[i] = sub(g[i], g[j]);

        ans = add(ans, mul(g[i], i));
    }
    cout << ans << "\n";

    return 0;
}

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

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma comment(linker, "/STACK:2000000")

#include "bits/stdc++.h"

using namespace std;

#define pb push_back
#define F first
#define S second
#define f(i,a,b)  for(int i = a; i < b; i++)
// #define endl '\n'
using ll = long long;
using db = long double;
using ii = pair<int, int>;

const int N = 2e5+5, LG = 19, MOD = 1e9+7;
const int SQ =320;
const long double EPS = 1e-7;
int n, k;
int cnt[100005];
ll ans[100005];
int fast(int b,int e){
  int res=1;
  for(;e;e>>=1,b=1ll*b*b%MOD)
    if(e&1)res=1ll*res*b%MOD;
  return res;
}
int32_t main(){
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif
  int n, k; cin >> n >> k;
  for(int j = 1; j <= k; j++){
    for(int i=j;i<=k;i+=j)cnt[j]++;
  }
  ll out=0;
  for(int i = k; i >= 1; --i){
    ans[i]+=fast(cnt[i],n);
    ans[i]%=MOD;
    for(int j = i+i;j<=k;j+=i)ans[i]-=ans[j];
    ans[i]%=MOD;
    if(ans[i]<0)ans[i]+=MOD;
    out+=ans[i]*i;
    out%=MOD;
  }

  cout<<out<<'\n';


  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int main() {
	int k,n
	cin >> n>>k;
	long long int sum = 0;
	for (int i = 1; i <= k; i++) {
		for (int j = 1; j <= k; j++) {
			for (int m = 1; m <= k; m++) {
				sum = sum + __gcd(i, __gcd(j, m));
			}
		}
	}
	cout << sum % mod;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'cin'
    6 |         cin >> n>>k;
      |         ^~~
Language: C

#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define mod 1000000007
#pragma GCC optimize ("-O2")
#define mod2 998244353
#define MAXN 1000000000
#define v32 vector<int>
#define v64 vector<lli>
#define v1024 vector <vector <int>>
#define v4096 vector <vector <lli>>
#define vt vector
#define f(x, y, z) for (lli x = y; x < z; x++)
#define fd(x, y, z) for (lli x = y; x > z; x--)
#define lb lower_bound
#define ld long double
#define m64 map<lli,lli>
#define m32 map<int,int>
#define m64it map<lli,lli>::iterator
#define m32it map<int,int>::iterator
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ist insert
#define endl "\n"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define p_q priority_queue 
#define min_p_q priority_queue <int,vt <int>,greater <int>>
using namespace std;
using namespace __gnu_pbds; 

//USE AT YOUR OWN RISK
lli tmod(lli x,lli m=mod){return (x%m+m)%m;}

template <typename T> 
void DEBUG_ARR(vt<T> a,char c)
{
	f(i,0,a.size())cout<<tmod(a[i])<<c;
	cout<<"\n";
}

//make sure x is below mod
lli power(lli x, lli y,lli m=mod) 
{
    lli res = 1;  
   
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x)%m; 
        y = y>>1; 
        x = (x*x)%m;  
    }
    if(res<0)
       res+=m; 
    return res; 
}


// lli fact[2000009];
// lli ncr(lli n,lli r){
//     lli ans=fact[n];
//     if(r>n)return 0;
//     ans=(ans*power(fact[n-r],mod-2))%mod;
//     ans=(ans*power(fact[r],mod-2))%mod;
//     return ans;
// }


int main() 
{ 
    // fact[0]=1;
    // f(i,1,2000001)fact[i]=(i*fact[i-1])%mod;
    
    fastio;
    int t;
    // cin>>t;
    t=1;
    int temp=t;
	while(t--){
        // cout<<"Case #"<<temp-t<<": ";
        lli n,k;cin>>n>>k;
        lli ans[k+1];
        memset(ans,1,sizeof ans);
        lli f[k+1];
        f(i,1,k+1)f[i]=power(k/i,n);
        lli g[k+1];
        fd(i,k,0){
            g[i]=f[i];
            for(lli j=2;j*i<=k;j++)g[i]=(g[i]-g[j*i])%mod;
        }
        lli tans=0;
        f(i,1,k+1)tans=(tans+i*g[i])%mod;
        cout<<tmod(tans);
    }   
    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>

int main(){
    using namespace std;
    constexpr unsigned long MOD = 1000000007;
    unsigned long N, K;
    cin >> N >> K;
    const auto& modpow = [](unsigned long a, unsigned long n, unsigned long b = 1) -> unsigned long {
        unsigned long r{b % MOD};
        while(n){
            if(n & 1)(r *= a) %= MOD;
            (a *= a) %= MOD;
            n >>= 1;
        }
        return r;
    };
    //vector<unsigned long> v(K + 1);
    cout << 0 << endl;
    return 0;
    unsigned long ans{0};
    for(unsigned long i{K}; i > 0; --i){
        v[i] = modpow(K / i, N);
        for(unsigned long j{2 * i}; j <= K; j += i)v[i] += MOD - v[j];
        ans += i * (v[i] %= MOD) % MOD;
    }
    cout << ans % MOD << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'v' was not declared in this scope
   22 |         v[i] = modpow(K / i, N);
      |         ^
Language: C

#include<bits/stdc++.h>
using namespace std;
#define int  long long 
#define speedrap ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int be(int a,int b,int mod) {if(b == 0) return 1; if(b%2 == 1) return (a*be(a,b-1,mod))%mod; else return (be(a,b/2,mod)*be(a,b/2,mod))%mod;}
const int mod = 1e9+7;
#define PI 3.14159265359
#define pf push_front
#define pb push_back
#define bitcount __builtin_popcount
#define sc(a) scanf("%d", &a);
#define sz(s) (int)s.size()
#define eb emplace_back
#define pf push_front
#define mkp(x,y) make_pair(x,y)
const int siz = 5*(1e5 + 1);
const int logi = 21;
const double epsilon = 1e-6;
int prime[siz];
bool cmp(const int &a,const int &b)
{
  return (abs(a-b)>1);
}




signed main()
{
 
	speedrap
	int t;
	t = 1;
	//cin>>t;
	while(t--)
	{
		int n,k;
		cin>>n>>k;
		int ans[k+1];
		memset(ans,0,sizeof(ans));
		int sum = 0;

		for(int i = k ; i >= 1 ; i--)
		{
			int div = k/i;
			if(div == 0)
			{
				div = 1;
			}
			//cout<<div<<" ";
			ans[i] = be(div,n,mod);

			int sub = 0;

			for(int j = 2*i ; j <= k ; j+= i)
			{
				sub = (sub + ans[j])%mod;
			}

			//cout<<ans[i]<<"\n";

			ans[i] = (ans[i] - sub + mod)%mod;
		}

		for(int i = 1 ; i <= k ; i++)
		{
			int p = i;
			p = (p*ans[i])%mod;
			sum = (sum + p)%mod;
		}

		cout<<sum<<"\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>
#define inf 1000000007
#define mod 1000000007
//#pragma GCC optimize(2)
#define int long long
using namespace std;
template <typename T> void read(T &x){
	x=0;char ch=getchar();int fh=1;
	while (ch<'0'||ch>'9'){if (ch=='-')fh=-1;ch=getchar();}
	while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
	x*=fh;
}
template <typename T> void write(T x) {
	if (x<0) x=-x,putchar('-');
	if (x>9) write(x/10);
	putchar(x%10+'0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
int qpow(int a,int k)
{
	int res=1;
	while(k)
	{
		if(k&1) res=res*a%mod;
		a=a*a%mod;
		k>>=1;
	}
	return res;
}
int n,k;
int cnt[100005];
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>k;
	int ans=0;
	for(int i=k;i>=1;i--)
	{
		int num=k/i;
		cnt[i]=qpow(num,n);
		for(int j=i*2;j<=k;j+=i)
			cnt[i]=(cnt[i]-cnt[j]+mod)%mod;
		ans=(ans+i*cnt[i])%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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
#define  st first
#define  nd second
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
 
#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
 
 
#define MOD   1000000007
const int LN =19;
#define int long long
const int  MAXN = 100004;
 
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef cc_hash_table<int, int, hash<int > > ht;
 
int mu[MAXN];
int f[MAXN];
int n , k ; 
void mobius(){
     mu[1] = 1;
	 for (int i = 1; i < MAXN; i++)
		for (int j = 2*i; j < MAXN; j += i)
		{
				mu[j] -= mu[i];
		}
}
 
int modular_pow(int  base, int exponent, int modulus)
{
    int result = 1;
    while (exponent > 0)
    {
        if (exponent % 2 == 1)
            result = (result * base) % modulus;
        exponent = exponent >> 1;
        base = (base * base) % modulus;
    }
    return result;
}
int fact[MAXN];
int invf[MAXN]; 

void fun(){
  for(int i=1;i<MAXN;i++){
    for(int j=i;j<MAXN;j+=i){
        f[j]= ((f[j]+((i*mu[j/i])%MOD))%MOD + MOD)%MOD;
    }
  }
 
}
int solve(){
   int ans=0;
   for(int d=1;d<=k;d++){
    ans=(ans+((f[d]* modular_pow(k/d,n ,MOD))%MOD))%MOD;
   }
   return ans;
}
void precal(){
  fact[0] = 1 ; 
  for(int i = 1; i<MAXN ; i++){
      fact[i] = (fact[i-1]*i)%MOD;
      invf[i] = modular_pow(fact[i],MOD-2,MOD);
  }
  mobius();
  fun();
}
int32_t main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  precal();
  cin >> n >> k ;
  cout<<solve();
}
 
 

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

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

const int MOD = 1e9+7;
class mint {
    ll x;
public:
    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 {
        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;
    }

    friend ostream &operator<<(ostream& os, const mint &m) {
        os << m.x;
        return os;
    }
};

ll GCD (ll a, ll b) { return b ? GCD(b, a%b) : a;}

ll LCM (ll a, ll b) {
    ll g = GCD (a, b);
    return a * b / g;
}

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

    ll N, K;
    cin >> N >> K;

    mint ans(0);

    vector<mint> used(1e5+1, mint(0)), cnt(1e5+1, mint(0));

    for (ll g = 1e5; g >= 1; g--) {
        mint tmp(K/g);
        tmp = tmp.pow(N);
        cnt[g] = tmp - used[g];
        // if (g <= 5) cout << g << " " << tmp << endl;
        for (ll i = 1; i*i <= g; i++) {
            if (g%i == 0) {
                used[i] += cnt[g];
                if (g/i != i) used[g/i] += cnt[g];
            }
        }
        ans += mint(g) * cnt[g];
        // if (g < 5) Rep (i, 5) {
        //     cout << used[i] << " \n"[i==4];
        // }
    }

    // Rep (i, 5) {
    //     cout << i << " " << cnt[i] << " " << used[i] << "\n";
    // }

    cout << ans << endl;
}

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

// ABEY SAALE
// QUESTION KHUD KR SOLUTION KYU DEKH RHA H
 
 
 
 
 
 
 
 
//MAAF KIJIYEGA ME GUSSE ME IDHAR UDHAR NIKAL JATA HU
#include<bits/stdc++.h>
#define mod 1000000007
#define fr first
#define se second
#define endl "\n"
#define ll long long
#define PI 3.1415926535 
#define pb push_back
#define mpr make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define senky_bansal ios_base::sync_with_stdio(false);
#define IIIT_ALLAHABAD    cin.tie(NULL);cout.tie(NULL);
using namespace std;

ll fac[2000005];
void pre(){ fac[0]=1; fac[1]=1; for(int i=2;i<200005;i++) fac[i]=(i*fac[i-1])%mod;}
ll power(ll a,ll b){ll res=1;while(b){if(b&1) res=(res*a)%mod;a=(a*a)%mod;b=b/2;}return res%mod;}
ll ncr(ll n,ll r){return ((fac[n]*power(fac[r],mod-2))%mod*power(fac[n-r],mod-2))%mod;}
// DEKHIYE JI  WALID JO THE ABBA HAMARE WO YEH function CHHOD KR GYE THE

signed main()
{   



      
      senky_bansal
      IIIT_ALLAHABAD
      
      // pre();
      ll t;
      // cin>>t;
      t=1;
      while(t--)
      { 
         
         ll n,k;
         cin>>n>>k;
         ll ans = 0;
         ll pr[k+5];
         for(int i=0;i<k+5;i++)
          pr[i]=0;
         ll have = 0;
         for(ll i=k;i>=1;i--)
         {
              ll p1 = k/i;
              ll p2 = power(p1,n);
              for(ll j=2*i;j<=k;j+=i)
              {
                 p2 = (p2-pr[j]+mod)%mod;
                 p2%=mod;
              }
              pr[i] = p2;
              ans+=(p2*(i))%mod;
              ans%=mod;
         }
         ans%=mod;
         cout<<ans<<endl;

      }
      






}



























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

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

int sum(vector<int> A, int N, int a) {
  int t = A.at(0);
  for (int i = 1; i < N; i++) {
    t = gcd(t, A.at(i));
  }
  a += t;
  return a;
}

int rui(int a, int N) {
  for (int i = 0; i < N; i++) {
    a *= a;
  }
  return a;
}

int zero(int a, int N) {
  int b = 0
  for (int i = 0; i < N; i++) {
    if (a % 10 == 0) {
      b = 1;
      break;
    }
  }
  return b;
}

int main() {
  int N, K, a, ans;
  cin >> N >> K;
  ans = 0;
  for (int i = 0; i < N; i++) {
    a++;
    a *= 10;
  }
  a--;
  while (true) {
    a++;
    if (zero(a, N) == 1) {
      continue;
    }
    int b = a
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
      vec.at(i) = b % 10;
      b /= 10;
    }
    ans += sum (vec, N, ans);
    if (a == rui(10, N)) {
      break;
    }
  }
  cout << ans % 100000007 << endl;
}

Compiler output:
a.cc: In function 'int zero(int, int)':
a.cc:22:3: error: expected ',' or ';' before 'for'
   22 |   for (int i = 0; i < N; i++) {
      |   ^~~
a.cc:22:19: error: 'i' was not declared in this scope
   22 |   for (int i = 0; i < N; i++) {
      |                   ^
a.cc: In function 'int main()':
a.cc:46:5: error: expected ',' or ';' before 'vector'
   46 |     vector<int> vec(N);
      |     ^~~~~~
a.cc:48:7: error: 'vec' was not declared in this scope
   48 |       vec.at(i) = b % 10;
      |       ^~~
a.cc:51:17: error: 'vec' was not declared in this scope
   51 |     ans += sum (vec, N, ans);
      |                 ^~~
Language: C

#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;

#define ll long long 
#define FI first 
#define SE second
#define pb push_back 
#define eb emplace_back
#define mod 1000000007
#define all(c) (c).begin(),(c).end()
#define LB  lower_bound
#define UB  upper_bound
#define max3(a,b,c) max(c,max(a,b))
#define min3(a,b,c) min(c,min(a,b))
#define mems(s, n) memset(s, n, sizeof(s))
#define NINF -1e18
#define INF 1e18
#define int ll int
#define OOK order_of_key  //no of elements less than
#define FBO find_by_order //iterator pointing kth element;indexing starts from 0
#define CK3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define CK4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl

typedef pair<int,int> PII;
typedef pair<pair<int,int>,int> PPII;
typedef pair<int,pair<int,int>> PIPI;
typedef map<int,int>MII;
typedef vector<int> VI;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int power(int a, int b)
{int x=1,y=a;while(b>0){if(b%2){x =(x*y)%mod;}y =(y*y)%mod;b/=2;}return x%mod;}

//int modInverse(int a, int m) {return power(a, m-2);} //gcd(a,m)=1 


signed main()
{
ios::sync_with_stdio(false); cin.tie(0);
int T=1,T1=0;//cin>>T;
while(T1++<T)
{//cout<<"Case #"<<T1<<": ";
 
 int n,k;
 cin>>n>>k;VI dp(100001,0);
 int ans=0,sum=0;
 for(int i=k;i>=1;i--)
 {
     int x=k/i;
     int mn=(power(x,n)-dp[i]+mod)%mod;
     ans=(ans+mn*i)%mod;
     //sum+=mn;
     //sum%=mod;
     int aa=i;
     for(int i1=1;i1*i1<=aa;i1++)
     {
         if(aa%i1==0)
         {
             dp[i1]+=mn;
             dp[i1]%=mod;
             if(aa/i1!=i1)
             {
                 dp[aa/i1]+=mn;
                 dp[aa/i1]%=mod;
             }
         }
         
     }
 }//cout<<sum<<endl;
 //int ab=(power(k,n)-sum+mod)%mod;
 //ans=(ans+ab)%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 ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll hpow(ll x,ll y){
    ll ans=1;
    ll i=x;
    if(y==0)return 1;
    while(y>0){
        if(y%2==1){
            ans=(ans*i)%i_7;
        }
        i=(i*i)%i_7;
        y=y/2;
        
    }
    return ans;
}

int main(){fastio
    ll n,k;cin>>n>>k;
    ll dp[k+1];
    dp[k]=1;
    ll ans=mod(k);
    for(ll i=k-1;i>=1;i--){
        dp[i]=hpow((ll)(k/i),n);
        rep(j,2,k){
            if(i*j>k){
                break;
            }
            dp[i]-=dp[i*j];
        }
        dp[i]=mod(dp[i]);
        ans=mod(ans+dp[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

#include <bits/stdc++.h>
using namespace std;
#include "string"
#define endl '\n'
#define pi pair<char,int>
#define ff first
#define ss second
#define int long long 
#define boost ios_base::sync_with_stdio(false);cin.tie(nullptr)

const int M = 1e9+7;
int mod(int n){
	n%=M;
	return (n+M)%M;
}

int power(int a,int b){
	int ans=1;
	while(b>0){
		if(b&1)
			ans=mod(ans*a);
		a=mod(a*a);
		b/=2;
	}
	return ans;
}

int32_t main() { 
    boost;
 
	int n,k;
	cin>>n>>k;
	int dp[k+1];
	for(int i=1;i<=k;i++)
		dp[i] = power(k/i,n);
	int ans=0;
	for(int i=k;i>=1;i--){
		for(int j=2*i;j<=k;j+=i){
			dp[i] = mod(dp[i]-dp[j]);
		}
		ans= mod(ans+mod(i*dp[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>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
ll mod=1e9+7;
long long pwr(long long x, long long e){
    if(e==0)
        return 1;
    long long tmp=pwr(x,e/2);
    tmp=(tmp*tmp)%mod;
    if(e%2)
        tmp=(tmp*x)%mod;
    return tmp;
}
ll dp[100010];
int main(){
    ll n, k;
    while(cin>>n>>k){
        ll ans=0;
        for(ll i=k; i>=1; --i){
        	dp[i]=pwr(k/i, n);
        	for(int j=i+i; j<=k; j+=i){
        		dp[i]-=dp[j];
        	}
        	ans+=i*dp[i];
        	ans%=mod;
        }
        if(ans<0){
        	ans+=mod;
        }
        printf("%lld\n",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<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<map>
using namespace std;
const int mod = 1e9+7;

int read(){
	int x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<3)+(x<<1)+c-48;c=getchar();}
	return x*f;
}

int fpm(int x,int y){
	int summ=1;
	while(y){
		if(y&1)summ=1ll*summ*x%mod;
		x=1ll*x*x%mod;
		y>>=1;
	}
	return summ;
}

int k,m,n,sum[1000010];
int main(){
	n=read();k=read();
	long long ans=0;
	for(register int i=k;i>=1;i--){
		sum[i]=fpm(k/i,n);
		for(register int j=i*2;j<=k;j+=i)
			(sum[i]=sum[i]-sum[j]+mod)%=mod;
		(ans+=1ll*sum[i]*i%mod)%=mod;
	}
	printf("%lld\n",ans);
	return 0;
}

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>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

ll mpow(ll x, ll n) { ll y = 1; for (; n; n /= 2) { y = n % 2 ? y * x % MOD : y; x = x * x % MOD; } return y; }

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

    vector<ll> dp(K + 1);
    ll ans = 0;
    for (ll g = K; g > 0; --g) {
        ll p = mpow(K / g, N);
        for (int n = 2 * g; n <= K; n += g) {
            p = (p + MOD - dp[n]) % MOD;
        }
        dp[g] = p;
        ans = (ans + p * g) % MOD;
    }
    write(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 <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, sum, k, ans[N];

int power(int a, int b, int m = mod){a %= m; if(b < 0)b += m-1; int r = 1; while(b){if(b&1)r=(r*a)%m; a = (a*a)%m; b>>=1;}return r;}

int32_t main(){_
   
   cin >> n >> k;

   for (int i = k; i >= 1; --i)
   {
      int choose = power((k/i), n);
      ans[i] = choose;
      for (int j = 2*i; j <= k; j+=i)
      {
         ans[i] -= ans[j];
         ans[i] %= mod;
      }
   }
   
   for (int i = 1; i <= k; ++i)
   {
      sum += i * ans[i];
      sum %= mod;   
   }
      
   cout<<sum;

   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
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define YOU using
#define DONT namespace
#define SAY std

YOU DONT SAY;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,ll> pil;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define REPP(i,a,b,d) for(int i=a;i<=b;i+=d)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=a;i>=b;i-=d)
#define REV(i,a,b) REVV(i,a,b,1)

#define FOR(i,a) for(int i=0; i<a; i++)
#define FORD(i,a) for(int i=(int)a-1; i>=0; i--)

#define pb push_back
#define F first
#define S second

const int OO = 1e9;
const ll INF = 1e18;

const int irand(int lo,int hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

const ll lrand(ll lo,ll hi){
	return ((double)rand()/(RAND_MAX + 1.0)) * (hi-lo+1) + lo;
}

#define getc getchar
template<typename T>
T getnum(){
	int sign = 1;
	T ret = 0;
	char c;

	do{
		c = getc();
	}while(c == ' ' || c == '\n');
	if(c == '-')sign = -1;
	else ret = c-'0';
	while(1){
		c = getc();
		if(c < '0' || c > '9')break;
		ret = 10*ret + c-'0';
	}
	return sign * ret;
}

inline void ini(int& x){
	x = getnum<int>();
}

inline void scani(int& x){
	scanf("%d",&x);
}

//end of macro

const ll MOD = 1e9 + 7;
inline ll addmod(ll a, ll b){
    if(a+b<MOD)return a+b;
    return a+b-MOD;
}
inline ll mulmod(ll a, ll b){
    return (a*b)%MOD;
}
inline ll expmod(ll a, ll e){
    ll ret = 1;
    while(e){
        if(e&1)ret = mulmod(ret, a);
        a = mulmod(a, a);
        e >>= 1;
    }
    return ret;
}

const int N = 1e5 + 5;

int mob[N];

int n,k;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #define endl '\n'
    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(10);

    mob[1] = 1;
    REP(i,2,N-1){
        if(mob[i] < 0){
            mob[i] = 0;
        }else{
            if(mob[i] == 0){
                REPP(j,i,N-1,i)mob[j]++;
                for(ll j = (ll)i*i; j < N; j += (ll)i*i) mob[j] = -OO;
            }
            mob[i] = (mob[i]&1) ? -1 : 1;
        }
    }

    cin>>n>>k;
    ll ans = 0;
    REP(g,1,k){ // gcd == g
        ll curr = 0;
        int lim = k/g;
        REP(i,1,lim){ // i as in multiplier
            curr = addmod(curr, mulmod(mob[i], expmod(lim/i, n)));
        }
        // printf("g = %d, ans = %lld\n",g,curr);
        ans = addmod(ans, mulmod(g, curr));
    }
    cout << ans << endl;

    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,mod=1e9+7;
ll n,k,ans[N];
ll qpow(ll a,ll n)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=ans*a%mod;
        a=a*a%mod;
        n>>=1;
    }
    return ans;
}
int main()
{
    scanf("%lld%lld",&n,&k);
    ll res=0;
    for(int i=k;i>=1;i--)
    {
        ans[i]=(ans[i]+qpow(k/i,n))%mod;
        res=(res+ans[i]*i)%mod;
        for(int j=1;j*j<=i;j++)
            if(i%j==0)
            {
                if(j!=i)
                    ans[j]=(ans[j]-ans[i])%mod;
                if(i/j!=j&&i/j!=i)
                    ans[i/j]=(ans[i/j]-ans[i])%mod;
            }
    }
    res=(res+mod)%mod;
    printf("%lld\n",res);
}


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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;

ll Pot(ll p, ll w)
{
    if (w == 0)
        return 1;
    if (w % 2 == 0)
    {
        ll pol = Pot(p, w / 2);
        return pol * pol % MOD;
    }
    return Pot(p, w - 1) * p % MOD;
}

int main()
{
    ios_base::sync_with_stdio(0);
    ll n, k;
    cin >> n >> k;
    vector<ll> dp(k + 1);
    dp[k] = 1;
    for (ll i = k - 1; i >= 1; --i)
    {
        ll kan = (k - k % i) / i;
        dp[i] = Pot(kan, n);
        for (ll j = 2 * i; j <= k; j += i)
        {
            dp[i] -= dp[j];
            if (dp[i] < 0)
                dp[i] += MOD;
        }
    }
    ll odp = 0;
    for (ll i = 1; i <= k; ++i)
        odp = (odp + i * dp[i]) % MOD;
    cout << odp;
    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;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rept(i,k,n) for(int i = (k); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define mod 1000000007
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pll;

template <typename T>
void vecprint(vector<T> &vec) {
    cout<<'[';
    for(T x:vec){
        cout<<x<<',';
    }
    cout<<']'<<endl;
    return;
}

ll powm(ll a,ll b){
    if(b==1) return a;
    if(b%2) return powm(a*a%mod,b/2)*a%mod;
    else return powm(a*a%mod,b/2)%mod;
}

int main() {
    ll n,k;
    cin>>n>>k;
    vector<ll> cnt(k+1,0);
    for(ll i=k;i>0;i--){
        ll tmp = powm(k/i,n);
        for(ll j=i*2;j<=k;j+=i){
            tmp=(tmp+mod-cnt[j])%mod;
        }
        cnt[i]=tmp;
    }
    ll ans=0;
    rept(i,1,k+1){
        ans+=cnt[i]*i;
        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<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

long long int pow_mod(long long int p_a,long long int p_n,long long int p_p=1e9+7){
	//p_a^p_n mod p_p
	long long int p_b=1,p_t=1;
	for(;p_b<=p_n;p_b<<=1);
	for(p_b>>=1;p_b>0;p_b>>=1){
		p_t*=p_t;
		if(p_t>=p_p)p_t%=p_p;
		if(p_n&p_b)p_t*=p_a;
		if(p_t>=p_p)p_t%=p_p;
	}
	return p_t;
}

LL t[110000];

int main(){
	int n,m;
	int i,j,k;
	LL a,b,c;
	cin>>n>>m;
	for(i=2;i<=m;i++){
		t[i]=pow_mod(m/i,n);
	}
	for(i=m;i>=2;i--){
		for(j=2;j<i && j<=400;j++){
			if(i%j)continue;
			k=i/j;
			if(j>k)break;
			t[j]-=t[i];
			if(t[j]<0)t[j]+=MAX;
			if(j!=k){
				t[k]-=t[i];
				if(t[k]<0)t[k]+=MAX;
			}
		}
	}
	a=pow_mod(m,n);
	LL s=0;
	for(i=2;i<=m;i++){
		a-=t[i];
		s+=t[i]*i;
		s%=MAX;
		if(a<0)a+=MAX;
	}
	s+=a;
	cout<<s%MAX<<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>
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	read(n);
	string s;
	cin >> s;
	
	int cnt[n + 10][3] = {};
	FORD (i, n - 1, 0)
	{
	    FOR (j, 0, 2) cnt[i][j] = cnt[i + 1][j];
	    if (s[i] == 'R') cnt[i][0]++;
	    if (s[i] == 'G') cnt[i][1]++;
	    if (s[i] == 'B') cnt[i][2]++;
	}
	
	int ans = 0;
	FOR (i, 0, n - 1)
	{
	    FOR (j, i + 1, n - 1)
	    {
	        if (s[i] == s[j]) continue;
	        char ch = 'R' + 'G' + 'B' - s[i] - s[j];
	        
	        if (ch == 'R') ans += cnt[j + 1][0];
	        if (ch == 'G') ans += cnt[j + 1][1];
	        if (ch == 'B') ans += cnt[j + 1][2];
	        
	        if (2*j - i < n && s[2*j - i] == ch) ans--;
	        //cout << i << " " << j << ": " << ans << " " << 2*j - i << " " << ch <<  " " << s[2*j - i] << endl;
	    }
	}
	
    cout << 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 <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

const int MOD=1000000007;
//~ const int MOD=998244353;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

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

ll ans[200000];

int main(){
	int n,K;cin>>n>>K;
	for(ll i=1;i<=K;i++){
		ll cnt=K/i;
		ans[i]=ppow(cnt,n);
	}
	ll res=0;
	for(int i=K;i>=1;i--){
		for(int j=i*2;j<=K;j+=i){
			(ans[i]+=MOD-ans[j])%=MOD;
		}
		(res+=i*(ll)(ans[i]))%=MOD;
	}
	cout<<res<<endl;
}

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