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

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

typedef long long ll;
#define REP(i,n) for(int(i)=0;(i)<(n);++(i))

const ll MOD = 1e9 + 7;

// a^n mod
ll modpow (int a, int n, ll mod = MOD) {
  int res = 1;
  while (n > 0) {
    if (n % 2 == 1) res = a % mod;
    a = a*a % mod;
    n = n/2;
  }
  return res;
}
  

int main () {
  int n, k;
  cin >> n >> k;
  
  ll sum = 0;
  
  for (int i = 1; i <= k; ++i) {
    sum += i * (powmod(k/i, n) - powmod(k/i - 1, n));
  }
  cout << sum << endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'powmod' was not declared in this scope
   28 |     sum += i * (powmod(k/i, n) - powmod(k/i - 1, n));
      |                 ^~~~~~
Language: C

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

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

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

#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<int(b);i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,n) for (int i=(n-1);i >= 0;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)((v).size())
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
using namespace std; using ll = long long; using P = pair<int,int>;
using vl = vector<ll>; using vvl = vector<vl>;
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << H << " ";
    debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
    for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
    return os;
}
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
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;
const int dx[8] = {1,0,-1,0,1,1,-1,-1}; const int dy[8] = {0,1,0,-1,1,1,-1,-1};
const ll mod = 1000000007;

ll modPow(ll a,ll n){
    if(n == 1) return a%mod;
    if(n%2 == 1) return (a*modPow(a,n-1))%mod;
    ll t = modPow(a,n/2);
    return t*t%mod;
}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int n,k;
    cin >> n >> k;
    // a[i]はgcdがiになる組個数
    // a[i]をgcdがiの倍数になる組の個数で初期化
    vl a(k+1);
    rep(i,1,k+1){
        a[i] = modPow(k/i,n);
    }
    // a[i]の初期値から余計なものを引く
    for(int i = k;i >= 1;i--){
        for(int j = 2;i*j <= k;j++){
            a[i] = (a[i] - a[i*j] + mod)%mod;
        }
    }
    ll ans = 0;
    rep(i,1,k+1){
        ans = (ans+a[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 unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
 
#define REP(a,b,c) for(ll (a)=(b);(a)<(c);(a)++)
#define PER(a,b,c) for(ll (a)=(b);(a)>=(c);(a)--)

ll ii(){ ll x; cin >> x; return x; }
string is(){ string x; cin >> x; return x; }
void oi(ll x){ cout << x; }
void od(ld x){ cout << fixed << setprecision(10) << x; }
void os(string x){ cout << x; }
void oie(ll x){ cout << x << endl; }
void ode(ld x){ cout << fixed << setprecision(10) << x << endl; }
void ose(string x){ cout << x << endl; }
void oe(){ cout << endl; }

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

ll m=1000000007;
ll dp[200000];

int main(){
    ll N=ii();
    ll K=ii();
    ll sum=0;

    PER(i,K,1){
        dp[i]=modpow(K/i,N,m);
        for(ll j=i*2;j<=K;j+=i){
            dp[i]-=dp[j];
            dp[i]=(dp[i]+m)%m;
        }
        sum+=i*dp[i];
        sum%=m;
    }
    oie(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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

ll pow_mod(ll a,ll b){
  if(b==0){
    return 1;
  }
  else if(b%2==1){
    return (a*pow_mod(a,b-1))%MOD;
  }
  else{
    ll t=pow_mod(a,b/2);
    return t*t%MOD;
  }
}

vector<ll> memo(200001,MOD+1);
ll cnt_gcd(ll a,ll k,ll n){
  if(memo[a]!=MOD+1){
    return memo[a];
  }
  ll b=pow_mod((k/a),n);
  ll i=1;
  while(a+a*i<=k){
    b =(b-cnt_gcd(a+a*i,k,n))%MOD;
    i++;
  }
  memo[a]=b%MOD;
  return b%MOD;
}
  
int main() {
  ll n,k;
  cin >> n >> k;
  ll ans=0;
  for(ll i=k;i>=1;i--){
    ans=(ans+i*(cnt_gcd(i,k,n)))%MOD;
  }
  cout << (ans+MOD)%MOD << 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 _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
typedef long long ll;
typedef vector<vector<ll>> vvl;
typedef vector<ll> vl;
typedef vector<vector<char>> vvc;
typedef vector<char> vc;
typedef pair<ll,ll> pll;
typedef priority_queue<string> priquest;
typedef priority_queue<string,vector<string>,greater<string>> rpriquest;
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
  return x+y-max(x,y);
}

const ll big=1000000007;
ll exp(ll x,ll y){
    if(y==0)return 1;
    if(x==1||x==0)return x;
    if(y%2==1)return (exp(x,y-1)*x)%big;
    ll t=exp(x,y/2);
    return (t*t)%big;
}


int main(){
    int n,k;cin >> n >> k;
    vector<ll> memo(k+1,0);
    for(int g=k;g>=1;g--){
        ll s=k/g;
        memo[g]=exp(s,n);
        for(int gg=2*g;gg<=k;gg+=g){
            memo[g]-=memo[gg];
            memo[g]%=big;
        }
    }
    ll ans=0;
    rep(i,k){
        ans+=memo[i+1]*(i+1);
        ans%=big;
    }
    if(ans<0)ans+=big;
    printf("%lld\n",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>
#include <type_traits>
using namespace std;

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

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

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

struct mint {
  ll x;
  mint(ll x=0) : x(x%mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x -= a.x) < 0) x += mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) {
    mint res(*this);
    return res*=a;
  }
};

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  ll n, k; std::cin >> n >> k;
  mint ans = 0;
  vector<mint> div(k);
  ddrep(i, k) {
    mint cnt = mypow(k/i, n);
    cnt -= div[i];
    ans += cnt * i;
    for (ll x = 1; x*x <= i; x++) if (i % x == 0) {
      div[x] += cnt;
      if (x * x != i) div[i/x] += cnt;
    }
  }
  std::cout << ans.x << "\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

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
#define CEIL(A,B) ((A)+(B)-1)/(B)
using namespace std;
typedef int_fast64_t ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
inline void fastio(){cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15);}
ll gcd(ll a,ll b){ll c=max(a,b);ll d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll modfact(ll a){ll b=1;FOR(i,2,a)b=b*i%MOD;return b;}
ll modpow(ll a, ll n){ll b=1;while (n>0){if(n&1)b=b*a%MOD;a=a*a%MOD;n>>=1;}return b;}
ll modcomb(ll n, ll k){ll b=1;k=min(n-k,k);DOWN(i,n,n-k+1)b=b*i%MOD;return b*modpow(modfact(k),MOD-2)%MOD;}

ll N, K;

int main() {
    fastio();
    cin >> N >> K;
    vector<ll> A(K + 1);
    ll ans = 0;
    for(int x = K; x >= 1; x--) {
        A[x] = modpow(K / x, N);
        ll i = 2;
        while(i * x <= K) {
            A[x] = (A[x] + MOD - A[i * x]) % MOD;
            i++;
        }
        ans = (ans + A[x] * x % MOD) % MOD;
    }
    cout << ans << endl;
	return 0;
}

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

#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

const int mod = 1e9 + 7;
vector<ll> x(100100);

ll PowModRepeatSquaring(int a, int p) {
    if (p == 0) return 1;
    if (p % 2 ==0) {
        ll t = PowModRepeatSquaring(a, p / 2);
        return t * t % mod;
    }
    else {
        return a * PowModRepeatSquaring(a, p - 1) % mod;
    }
}

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

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n, k;
    cin >> n >> k;

    ll ans = 0;
    for (int i = k; i > 0; --i) {
        ll cnt = ((PowModRepeatSquaring(k / i, n) - x[i]) % mod + mod) % mod;
        ans = (ans + i * cnt) % mod;

        vector<ll> d = divisor(i);
        for (auto &it : d) {
            x[it] = (x[it] + cnt) % 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;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const long long MOD = 1e9+7;
long long n, k;
vector<long long> dp(100100, 0);

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() {
    cin >> n >> k;
    long long ans = 0;
    for(int i = k; i > 0; --i) {
        int check = i;
        long long cnt = k/i;
        long long indata = modpow(cnt, n, MOD);
        int now = 2;
        while(now*check <= k) {
            indata -= dp.at(now*check);
            indata %= MOD;
            if(indata < 0) indata += MOD;
            now++;
        }
        dp.at(check) = indata;
        ans += (indata*i) % MOD;
        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: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long k = sc.nextLong();
    long MOD = (long)Math.pow(10, 9) + 7;
    long[] dp = new long[(int)k + 1];
    for(long i = k; i >= 1; i--) {
      long t = k / i;
      long s = func(t, n);
      long u = 0;
      for(long j = (2 * i); j <= k; j += i) {
        u = (u + dp[j]) % MOD;
      }
      dp[(int)i] = (s + MOD - u) % MOD; 
    }
    long ans = 0;
    for(long i = 1; i <= k; i++) {
      long t = (i * dp[(int)i]) % MOD;
      ans = (ans + t) % MOD;
    }
    System.out.println(ans);
  }

  public static long func(long a, long x) {
    if(x == 0) return 1;
    if((x % 2) == 0) {
      long t = func(a, x / 2);
      return (t * t) % MOD;
    } else {
      return (a * func(a, x - 1)) % MOD;
    }
  }
}

Compiler output:
Main.java:15: error: incompatible types: possible lossy conversion from long to int
        u = (u + dp[j]) % MOD;
                    ^
Main.java:31: error: cannot find symbol
      return (t * t) % MOD;
                       ^
  symbol:   variable MOD
  location: class Main
Main.java:33: error: cannot find symbol
      return (a * func(a, x - 1)) % MOD;
                                    ^
  symbol:   variable MOD
  location: class Main
3 errors
Language: C

#include <iostream>
#include <vector>

const long mod = 1000000007l;

int main(){
  long N, K;
  std::cin >> N >> K;
  std::vector<long> sum(K, 0l);
  for(long k = K; k >= 1; --k){
    long el = K/k;
    long num = 1l;
    std::vector<long> bit(64, K/k);
    for(int i = 0; i < 64; ++i){
      for(int j = 0; j < i; ++j){
        bit[i] *= bit[i];
        bit[i] %= mod;
      }
    }
    for(int i = 0; i < 64; ++i){
      if((N >> i) & 1l){
        num *= bit[i];
        num %= mod;
      }
    }
    sum[k-1] = num;
    for(long i = 2; i*k <= K; ++i){
      sum[k-1] -= sum[i*k - 1];
    }
  }
  long count = 0;
  for(long i = 0; i < K; ++i){
    count += sum[i] * (i+1);
    count %= mod;
  }
  std::cout << count << std::endl;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define ll int64_t
#include <cstdlib> 
#include <math.h>
#include<cstdio>
#include<cstring>
#define FOR(I, A, B) for (ll I = (A); I <= (B); I++)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fo(i,n) for(ll i=0;i<n;i++)
#define sz(a) ll((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define dbg(x) cout << #x << " = " << x << endl
#define dbg2(x,y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define dbg3(x,y,z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl
#define dbg4(x,y,z,q) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << ", " << #q << " = " << q << endl
#define scan(char_array) scanf("%[^\n]s",&char_array);
const ll MOD=1000000007;

ll Power(ll base , ll e)
{
    if(e == 0) return 1;
    ll ans = base; e--;
    while(e)
    {
        if(e & 1) ans = (ans * base) %MOD;
        base = (base * base) %MOD;
        e >>= 1;
    }
    return (ans+MOD)%MOD;
}

int main(){
 IOS
 ll n,k;
 cin>>n>>k;
 //ll ans=0;
 ll dp[k+1];
 for(ll i=k;i>=1;i--){
 	ll total=(Power(k/i,n)%MOD);
 	ll tmp=0;
 	for(ll j=2;i*j<=k;j++){
 		tmp=(tmp+dp[j*i])%MOD;

 	}
 	dp[i]=(total-tmp+MOD)%MOD;

 }
 ll ans=0;
 //dbg(dp[2]);
 FOR(i,1,k){
 	ans=(ans+i*dp[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 <iostream>
#include <algorithm>
#include <vector>

using namespace std;

const int MOD = 1000 * 1000 * 1000 + 7;

long long addm(long long a, long long b)
{
	return (a + b) % MOD;
}

long long subm(long long a, long long b)
{
	return addm(a, MOD - b);
}

long long mulm(long long a, long long b)
{
	return (a * b) % MOD;
}

long long powm(long long a, long long n)
{
	if (n == 0) {
		return 1;
	}
	else if (n % 2 == 0) {
		return powm(mulm(a, a), n / 2);
	}
	else {
		return mulm(a, powm(mulm(a, a), n / 2));
	}
}

int main()
{
	int N, K;
	cin >> N >> K;
	vector<long long> dp(K + 1);

	for (int i = K; i >= 1; --i) {
		dp[i] = powm(K / i, N);
		for (int j = 2 * i; j <= K; j += i) {
			dp[i] = subm(dp[i], dp[j]);
		}
	}

	long long ans = 0;
	for (int i = 1; i <= K; ++i) {
		ans = addm(ans, mulm(i, dp[i]));
	}
	cout << ans << endl;
}


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>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define line cout<<"----------------------------"<<endl;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
#define filein freopen("input.txt","r",stdin)
#define fileout freopen("output.txt","w",stdout)
using namespace std;
const ll  mx=100009;
ll  sum[mx];
ll  bigmod(ll  a,ll  b, ll  m)
{
    ll  ans=1;
    a%=m;
    while(b)
    {
        if(b&1) ans=(ans*a)%m;
        b>>=1; ; a=(a*a)%m;
    }
    return ans;
}
int  main()
{
    ll  n,k;
    cin>>n>>k;
    for(ll  i=1;i<=k;i++)
    {
        sum[i]=bigmod(k/i,n,mod);
    }
    for(ll  i=k;i>=1;i--)
    {
        for(int j=i*2;j<=k;j+=i)
        {
            sum[i]-=sum[j];
            sum[i]=(sum[i]+mod)%mod;
        }
    }
    ll  ans=0;
    for(ll  i=1;i<=k;i++)
    {
        ans+=(sum[i]*i)%mod;
        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

// E - Sum of gcd of Tuples (Hard)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define irp(i,s,e) for(int i=(s);i>(e);--i)

#define MOD 1'000'000'007

// a^n mod m を計算する(繰り返し二乗法,二分累乗法:O(logn))
ll modpow(ll a, ll n) {
	ll m = MOD;
	ll x = 1;
	while(n > 0){
		if(n & 1) x = x * a % m;
		a = a * a % m;
		n >>= 1;
	}
	return x;
}

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

	vector<ll> cnt_gcd(K+1);

	irp(g, K, 1-1){ // g:[K,1,-1] fixed gcd
		cnt_gcd[g] = modpow(K/g, N); // number of multiples of g
		rp(n, 2, K+1){ // n:[2,K]
			if(n*g > K) break;
			cnt_gcd[g] -= cnt_gcd[n*g];
		}
	}

	ll ans = 0;
	rp(g, 1, K+1) ans = (ans + (cnt_gcd[g] * g % MOD)) % MOD;
	cout<< ans <<endl;
}

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

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pr pair<int,int>
#define mod 1000000007
#define endl "\n"

int power(int a,int b)
{
	if(b==1)	return a;
	int res=power(a,b/2);
	res=(res*res)%mod;
	if(b%2)	res=(res*a)%mod;
	return res;
}

void add(int &a,int b)
{
	a=(a+b)%mod;
}

void subtract(int &a,int b)
{
	a=(a-b+mod)%mod;
}

void solve()
{
	int n,i,j,k,x;
	cin>>n>>k;
	int a[k+1],ans=0;
	for(i=k;i>0;i--)
	{
		x=k/i;
		a[i]=power(x,n);
		for(j=2*i;j<=k;j+=i)
			subtract(a[i],a[j]);
		add(ans,(a[i]*i)%mod);
	}
	cout<<ans<<endl;
}
 
int32_t main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
    	int t=1;
	//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

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

//繰り返し二乗法
ll mod_pow(ll x,ll n){
	ll res = 1;
	while(n > 0){
		if(n & 1){
			res = res * x % mod;
		}
		x = x * x % mod;
		n >>= 1;
	}
	return res;
}

int main(){
	ll n;cin>>n;
	ll k;cin>>k;
	vector<ll> a(k + 1);
	for(ll i = 1; i <= k; i++) {
		a[i] = mod_pow((k / i),n);
	}
	ll ans = 0;
	vector<ll> cnt(k + 1);
	for(ll i = k; i >= 1; i--) {
		ll tmp = a[i];
		ll x = 2;
		while(x * i<= k){
			tmp -= cnt[x * i];
			x++;
		}
		cnt[i] = tmp;
	}
	for(ll 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 rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

template<int Mod> class ModInt {
  int v;
public:
  constexpr ModInt(const long long x = 0) noexcept : v((x % Mod + Mod) % Mod) {};
  constexpr ModInt &operator+=(const ModInt rhs) noexcept {
    v += rhs.v;
    if (v >= Mod)
      v -= Mod;
    return *this;
  }
  constexpr ModInt &operator-=(const ModInt rhs) noexcept {
    if (v < rhs.v)
      v += Mod;
    v -= rhs.v;
    return *this;
  }
  constexpr ModInt &operator*=(const ModInt rhs) noexcept {
    v = int(1LL * v * rhs.v % Mod);
    return *this;
  }
  constexpr ModInt &operator/=(ModInt rhs) noexcept {
    long long exp = Mod - 2;
    while (exp) {
      if (exp & 1)
        *this *= rhs;
      rhs *= rhs;
      exp >>= 1;
    }
    return *this;
  }
  constexpr ModInt operator-() const noexcept { return ModInt(-v); }
  constexpr ModInt operator+(const ModInt rhs) const noexcept {
    return ModInt(*this) += rhs;
  }
  constexpr ModInt operator-(const ModInt rhs) const noexcept {
    return ModInt(*this) -= rhs;
  }
  constexpr ModInt operator*(const ModInt rhs) const noexcept {
    return ModInt(*this) *= rhs;
  }
  constexpr ModInt operator/(const ModInt rhs) const noexcept {
    return ModInt(*this) /= rhs;
  }
  constexpr bool operator==(const ModInt rhs) const noexcept {
    return v == rhs.v;
  }
  constexpr bool operator!=(const ModInt rhs) const noexcept {
    return v != rhs.v;
  }
  constexpr ModInt pow(long long exp) const noexcept {
    ModInt res(1), mul(v);
    while (exp) {
      if (exp & 1)
        res *= mul;
      mul *= mul;
      exp >>= 1;
    }
    return res;
  }
  friend ostream &operator<<(ostream &os, const ModInt obj) noexcept {
    return os << obj.v;
  }
  friend istream &operator>>(istream &is, ModInt &obj) noexcept {
    long long tmp;
    is >> tmp;
    obj = ModInt<Mod>(tmp);
    return is;
  }
};
constexpr int MOD = 1000000007;
using mint = ModInt<MOD>;

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<mint> res(k);
  for (int i = k; i > 0; i--) {
    res[i-1] = mint(k/i).pow(n);
    for (int j = i*2; j <= k; j += i)
      res[i-1] -= res[j-1];
  }
  mint ans = 0;
  rep(i, k)
    ans += res[i]*(i+1);
  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 <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

// aのn乗を求める。計算量はO(logn)
ll modpow(ll a, ll n) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1))%mod;
    }
    return (modpow(a, n/2) * modpow(a, n/2))%mod;
}

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

    vl w(k+1);
    exrep(x, 1, k) {
        w[x] = modpow(k/x, n);
    }

    vl v(k+1);  // v[x] : GCDがxになる組み合わせの数
    for(ll x = k; x >= 1; x--) {
        ll u = 0;
        for(ll i = 2*x; i <= k; i += x) {
            u += v[i];
            u %= mod;
        }
        v[x] = (w[x] + mod - u)%mod;
    }

    ll ans = 0;
    exrep(x, 1, k) {
        ans += x*v[x];
        ans %= mod;
    }

    out(ans);
    re0;
}c

Compiler output:
a.cc:71:2: error: 'c' does not name a type
   71 | }c
      |  ^
Language: C

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

// aのn乗を求める。計算量はO(logn)
ll modpow(ll a, ll n) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1))%mod;
    }
    return (modpow(a, n/2) * modpow(a, n/2))%mod;
}

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

    vl w(k+1);
    exrep(x, 1, k) {
        w[x] = modpow(k/x, n);
    }

    vl v(k+1);  // v[x] : GCDがxになる組み合わせの数
    for(ll x = k; x >= 1; x--) {
        ll u = 0;
        for(ll i = 2*x; i <= k; i += x) {
            u += v[i];
            u %= mod;
        }
        v[x] = (w[x] + mod - u)%mod;
    }

    ll ans = 0;
    exrep(x, 1, k) {
        ans += x*v[x];
        ans %= mod;
    }

    out(ans);
    re0;
}

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


#include<iostream>

using namespace std;

long long modsum(long long, long long, long long);
long long modpow(long long, long long, long long);
long long modtime(long long, long long, long long);


int main() {
	int n, k;
	cin >> n >> k;
	const int base = (int)pow(10, 9) + 7;
	long long count = 0;
	long long* kosuu = new long long[k];
	for (int i = 0;i < k;i++) {
		kosuu[i] = 0;
	}
	for (int i = k;i > 0;i--) {
		kosuu[i-1] = modpow(k / i, n, base);
		for (int j = 2*i;j <= k;j+=i) {
			kosuu[i-1] = modsum(kosuu[i-1], -kosuu[j-1], base);
		}
		count = modsum(count, modtime(kosuu[i-1],i,base), base);
	}
	


	cout << count << "\n";
}

long long modsum(long long a, long long b, long long c) {
	if (a < 0)a += c;
	if (b < 0)b += c;
	return (a + b) % c;
}

long long modpow(long long a, long long b, long long c) {
	bool* bin;
	long long ans = 1;
	long long work;
	int n = 0;
	work = b;
	while (work > 0) {
		n++;
		work /= 2;
	}
	bin = new bool[n];
	work = b;
	for (int i = 0;i < n;i++) {
		bin[i] = work % 2;
		work /= 2;
	}
	for (int i = 0;i < n;i++) {
		if (!bin[i])continue;
		work = a;
		for (int j = 0;j < i;j++) {
			work =modtime(work,work,c);
		}
		ans =modtime(ans,work,c);
	}
	return ans;
}

long long modtime(long long a, long long b, long long c) {
	return (a * b) % c;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: 'pow' was not declared in this scope
   14 |         const int base = (int)pow(10, 9) + 7;
      |                               ^~~
Language: C

#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> P;
typedef priority_queue<P,vector<P>,greater<P>> P_queue;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define ALL(a) a.begin(),a.end()
#define SORT(a) sort(ALL(a))
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end());

const ll MOD=998244353;
const ll mod=1000000007;
const ll INF=1e15;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};

mat mul(mat &A, mat &B){
    mat C(A.size(), vec(B[0].size()));
    for(int i=0;i<A.size();i++){
        for(int k=0;k<B.size();k++){
            for(int j=0;j<B[0].size();j++){
                C[i][j]=(C[i][j]+A[i][k]*B[k][j])%mod;
            }
        }
    }
    return C;
}

mat marui(mat A, ll n){
    mat B(A.size(),vec(A.size()));
    for(int i=0;i<A.size();i++) B[i][i]=1;
    while(n>0){
        if(n&1) B=mul(B,A);
        A=mul(A,A);
        n>>=1;
    }
    return B;
}

ll yaku(ll a, ll b){
    if(a>b) return yaku(b,a);
    else{
        if(b%a==0) return a;
        else return yaku(b%a,a);
    }
}

int main(){
    ll N,K; cin>>N>>K;
    mat fn(K+1,vec(K+1,0));

    REP(i,1,K+1) REP(j,1,K+1) fn[i][yaku(i,j)]++;
    fn=marui(fn,N-1);
    ll ans=0;
    REP(i,1,K+1) REP(j,1,K+1) ans=(ans+fn[i][j]*j)%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 <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
int N;
ll K;
ll Memo[100005]; // gcdがidxのときの場合の和
map<int, ll> M;

ll calc_npow(ll num) {
  ll tmp =1ll;
  rep(i, N) {
    tmp*=num;
    tmp%=MOD;
  }
  return tmp;
}

void init() {
  rep(i, K) M[K/(i+1)]=-1;
  for (auto p: M) M[p.first] = calc_npow(p.first);
} 

void calc(ll num) {
  ll cnt = M[K/num];
  ll idx=2ll;
  while(num*idx<=K) {
    cnt-=Memo[num*idx];
    cnt%=MOD;
    idx++;
  }
  if (cnt<0) cnt+=MOD;
  Memo[num] =cnt;
}

int main() {
  INCANT;
  cin >> N >> K;
  init();
  for(ll i=K; i>=1; i--) calc(i);
  ll ans =0ll;
  rep(i, K) {
    ans+=Memo[i+1]*ll(i+1);
    ans%=MOD;
  }
  if (ans<0) ans+=MOD;
  cout << ans << "\n";
  return 0;
}

Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
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;

const LL MOD = 1000000007LL;

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<LL> count(N+1);
  LL ret = 0;
  for(int i=K; i>=1; --i) {
    LL n = modpow(K / i, N);
    for(int j=i*2; j<=K; j+=i) {
      n = (n + MOD - count[j]) % MOD;
    }
    count[i] = n;
    ret = (ret + n * i) % MOD;
  }
  cout << ret << 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;

const int md = 1e9 + 7;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  auto powr = [&](int base, int power) {
    int res = 1;
    while (power > 0) {
      if (power & 1) {
        res = 1ll * res * base % md;
      }
      base = 1ll * base * base % md;
      power >>= 1;
    }
    return res;
  };
  vector<vector<int>> div(k + 1);
  for (int d = 1; d <= k; d++) {
    for (int j = d + d; j <= k; j += d) {
      div[j].push_back(d);
    }
  }
  vector<int> dp(k + 1);
  int ans = 0;
  for (int g = k; g > 0; g--) {
    (dp[g] += powr(k / g, n)) %= md;
    for (int d : div[g]) {
      (dp[d] += md - dp[g]) %= md;
    }
    (ans += 1ll * g * dp[g] % md) %= md;
  }
  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

//Catchharsh
#include<bits/stdc++.h>
#define ll long long int 
#define ld long double
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define F first
#define S second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define see(x) cout<<#x<<" = "<<x<<endl
const ll MOD = 1e9+7;
const ll INF = 1011111111;
const ll LLINF = 1000111000111000111LL;
const ld EPS = 1e-10;
const ld PI = 3.14159265358979323;
using namespace std;
ll power (ll base,ll exponent)
{
    ll ans=1;
    base%=MOD;
    exponent%=(MOD-1);
    while(exponent!=0)
    {
      if(exponent&1) ans=(1LL*ans*base)%MOD;
      base=(1LL*base*base)%MOD;
      exponent>>=1;
    }
    return ans;
}

int32_t main()
{   
     IOS;
     
     ll n,m,i,j,k;
     string s;
     cin>>n>>k;
     ll sum=0;
     // sum+=z;
     ll xterms=0;
     ll dp[k+1];
     // cout<<sum<<endl;
     for(i=1;i<=k;i++)
     {
     	ll div=k/i;
     	dp[i]=power(div,n);
     }
     for(i=k;i>=1;i--)
     {
     	for(j=2;j*i<=k;j++)
     	{
     		dp[i]-=dp[j*i];
     		dp[i]+=MOD;
     		dp[i]%=MOD;
     	}
     }
     // ll sum=0;
     for(i=1;i<=k;i++)
     {
     	// cout<<dp[i]<<endl;
     	sum+=(i*dp[i])%MOD;
     	sum%=MOD;
     }
     cout<<sum;

     
     cerr <<endl<< "Time elapsed : " << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';             
}

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;
const int mod=1000000007;
int N,K;
long ans;
vector<long> X(100100);
long power(long a, long n, long m)
{
        long ret = 1;
        for (; n > 0; n >>= 1, a = a * a % m)
        {
                if (n % 2 == 1)
                {
                        ret = ret * a % m;
                }
        }
        return ret;
}

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

main()
{
        cin>>N>>K;
        for(int i=K;i>0;i--)
        {
                long res=((power(K/i,N,mod)-X[i])%mod+mod)%mod;
                ans=(ans+res*i+mod)%mod;
                vector<long> d=divisor(i);
                for(auto &it : d)X[it]=(X[it]+res+mod)%mod;
        }
        cout<<ans<<endl;
}

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;

int64_t beki(int64_t n,int64_t x){
  vector<int64_t> vec(50);
  int64_t i,s,ans;
  i=0;
  ans=1;
  cin>>n>>x;
  while(x>0){
  vec.at(i)=x%2;
    x=x/2;
  i++;    
  }
  s=n;
  for(int64_t j=0;j<50;j++){
  if(vec.at(j)==1){ans=(ans*s)%1000000007;}  
   s=(s*s)%1000000007; 
   
  } return ans;}
  
 
  
int main() {
int64_t n,k,a;
  a=0;
  cin>>n>>k;
  vector<int64_t> dp(k);
  dp.at(0)=1;
  for(int64_t i=1;i<k;i++){
    dp.at(i)=beki(i+1,n);
 if(i>=2){ for(int64_t j=2;j<i+1;j++){
   dp.at(i)=dp.at(i)-dp.at(((i+1)/j)-1);
    if(dp.at(i)<0){dp.at(i)+=1000000007;}}
  }
  if(i==1){dp.at(i)=beki(2,n);}
    dp.at(i)--;
    if(dp.at(i)<0){dp.at(i)+=1000000007;}
  }
 for(int64_t i=0;i<k;i++){a+=dp.at((k/(i+1))-1)*(i+1);
                         while(a>=1000000007){a=a-1000000007;}}
  cout<<a<<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;

#define int long long
const int MOD=1e9+7;
int pw(int n,int k){
  assert(k>=0);
  int res=1;
  while(k){
    if(k&1)(res*=n)%=MOD;
    (n*=n)%=MOD;
    k>>=1;
  }
  return res;
}

int F[123456];

signed main(){
  int n,k;cin>>n>>k;
  for(int i=1;i<=k;i++){
    F[i]+=i;
    for(int j=i+i;j<=k;j+=i){
      (F[j]-=F[i])%=MOD;
    }
  }
  int ans=0;
  for(int i=1;i<=k;i++){
    ans+=pw(k/i,n)*(MOD+F[i])%MOD;
  }
  cout<<ans%MOD<<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

n = str(input())
k = int(input())
dp = [[[0 for i in range(len(n)+1)] for i in range(2)] for i in range(len(n)+1)]
dp[0][0][0] = 1
for a in range(len(n)):
  for b in range(2):
    for c in range(len(n)):
      for i in range(10):
        if b ==1:
          if i != 0:
            dp[a+1][1][c+1] += dp[a][1][c]
          else:
            dp[a+1][1][c] += dp[a][1][c]
        else:
          if int(n[a]) > i and i ==0:
            dp[a+1][1][c] += dp[a][0][c]
          if int(n[a]) > i and i != 0:
            dp[a+1][1][c+1] += dp[a][0][c]
          if int(n[a]) == i and i ==0:
            dp[a+1][0][c] += dp[a][0][c]
          if int(n[a]) == i and i !=0:
            dp[a+1][0][c+1] += dp[a][0][c]
print(dp[-1][0][k] + dp[-1][1][k])           


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = str(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'str' [-Wimplicit-function-declaration]
    1 | n = str(input())
      |     ^~~
main.c:1:9: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | n = str(input())
      |         ^~~~~
main.c:1:5: error: initializer element is not constant
    1 | n = str(input())
      |     ^~~
main.c:2:1: error: expected ',' or ';' before 'k'
    2 | k = int(input())
      | ^
Language: C

#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

//累乗(aのk乗)
ll matpow(ll a,int k){
    ll dp=1,mt=a;
    while(k>0){
        if(k & 1)dp=(dp*mt)%mod;
        mt=(mt*mt)%mod;
        k/=2;
    }
    return dp;
}

int main(){
    int N; ll K; scanf("%d %lld", &N, &K);
    ll ans = K;
    vec dp(K+1); dp[K]=1;
    for(int i=K-1; i>0; i--){
        dp[i] = matpow(K/i, N);
        ll res = 0;
        FOR(j, 2, K/i+1){
            res = (res + dp[i*j]) % mod;
        }
        dp[i] = (dp[i] - res + mod) % mod;
        ans = (ans + i * dp[i]) % mod; 
    }
    printf("%lld\n", ans);
}

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

def pow(b, e):
    res = 1
    while e:
        if e & 1:
            res = (res * b) % MOD
        e >>= 1
        b = (b * b) % MOD
    return res


MOD = 10 ** 9 + 7
N, K = map(int, input().split())
counts = [0] * (K + 1)
ans = 0
for i in range(K, 0, -1):
    counts[i] = pow(K // i, N)
    for j in range(i + i, K + 1, i):
        counts[i] = (counts[i] + MOD - counts[j]) % MOD
    ans = (ans + i * counts[i]) % MOD
print(ans)


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def pow(b, e):
      | ^~~
Language: C

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

typedef long long ll;
typedef pair<int, int> P;

const ll mod =  1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;   // INFの値は1152921504606846976

ll pow(ll x,ll n){  // xのn乗 (mod m)
    ll res = 1;
    if(n > 0){
        res = pow(x,n / 2);
        if(n % 2 == 0){
            res = (res * res) % mod;
        }else{
            res = (((res * res) % mod) * x) % mod;
        }
    }
    return res;
}

int main()
{
    ll n,k;  cin >> n >> k;
    ll ans = 0;
    ll cnt[k+1];   // sub[i] := iのときのgcdの数
    rep(i,k+1) cnt[i] = 0;

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

    for(int i = k; i >= 1; i--){
        ans += ( i * cnt[i] );
        //cout << i << ':' << pow((k/i),n) - pow((k/i)-1,n) << endl;
        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>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds; 
using namespace std;

using   ll=long long;
using   ld=long double;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ordered_set 	tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>
#define endl        	"\n"
#define int         	long long int  
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define pll         	pair<ll,ll>
#define vec     		vector<ll>
#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007

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

ll mod_inverse(ll a)
{
	return mod_pow(a,mod-2);
}

void solve()
{
	int n,k;
	
	cin>>n>>k;
	
	ll dp[k+5];
	
	fill(dp,0);
	
	for(int i=k;i>=1;i--)
	{
		dp[i] = mod_pow(k/i,n);
		
		for(int j=2*i;j<=k;j+=i)
		{
			dp[i] = (dp[i] - dp[j] + mod) % mod;
		}
	}
	
	int ans = 0;
	
	for(int i=1;i<=k;i++)
	{
		ans = (ans + (dp[i]*i)%mod)%mod;
	}
	
	cout<<ans;
}

signed main()
{
 
    fast;
 
    ll t;
    
    t=1;
    
    //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

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

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}

ll pow(ll a, ll b){
	ll ret = 1;
	while(0 < b){
		if(b % 2 == 1){
			ret = ret * a % MOD;
		}
		a = a * a % MOD;
		b >>= 1;
	}
	return ret;
}

int main(){
	ll n, k;
	cin >> n >> k;
	vector<ll> a(k+1, 0);
	for(ll i = k; 1 <= i; --i){
		a[i] = pow(k / i, n);
		int ii = 2;
		while(ii * i <= k){
			a[i] = (a[i] - a[ii * i]) % MOD;
			if(a[i] < 0) a[i] += MOD;
			ii++;
		}
	}
	
	ll ans = 0;
	for(ll i = 1; i <= k; ++i){
		ans += a[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.