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

#include <vector>
#include <iostream>
using namespace std;

template<long long mod>
class modint{
private:
  long long a;
public:
  constexpr modint(const long long x = 0) noexcept : a(x%mod) {}
  constexpr long long& value() noexcept { return a; }
  constexpr const long long& value() const noexcept { return a; }
  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 modint& operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if(a >= mod) a -= mod;
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if(a < rhs.a) a += mod;
    a -= rhs.a;
    return *this;
  }
  constexpr modint& operator*=(const modint rhs) noexcept {
    a = a*rhs.a%mod;
    return *this;
  }
  constexpr modint& operator/=(modint rhs) noexcept {
    long long k = mod-2;
    while(k > 0){
      if(k&1){
        *this *= rhs;
      }
      rhs *= rhs;
      k /= 2;
    }
    return *this;
  }
  friend ostream& operator<<(ostream &os, const modint &X){
    return os << X.a;
  }
  friend istream& operator>>(istream &is, modint &X){
    is >> X.a;
    X.a %= mod;
    if(X.a < 0) X.a += mod;
    return is;
  }
};

template<typename T>
T power(T x, long long k){
  T ret{1};
  while(k > 0){
    if(k&1) ret *= x;
    x *= x;
    k /= 2;
  }
  return ret;
}

int main(){
  using mint = modint<(int)1e9+7>;
  int N, K;
  cin >> N >> K;
  mint ans = 0;
  vector<int> D(K+1,1);
  vector<mint> C(K+1);
  C[1] = 0;
  for(int i = 1; i <= K; ++i){
    C[i] += i;
    for(int j = 2; j*i <= K; ++j){
      C[i*j] -= C[i];
    }
  }
  for(int i = 1; i <= K; ++i){
    ans += power<mint>(K/i,N)*(C[i]);
  }
  cout << ans << endl;
}


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

#include <bits/stdc++.h>
#include "../lib/math/modpow.hpp"

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

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

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

  vector<ll> ans(k+1);
  for(ll i=1;i<=k;++i) {
    ans[i] = mod_pow<ll>(k/i, n, MOD);
  }
  //printv(ans);

  for(ll i=k-1;i>=1;--i) {
    for(ll j=2*i;j<=k;j+=i) {
      ans[i] = (ans[i] + MOD - ans[j]) % MOD;
    }
  }

  ll su = 0;
  for(ll i=1;i<=k;++i) {
    su += ans[i] * i % MOD;
    su %= MOD;
  }
  cout << su << endl;
  
}


Compiler output:
a.cc:2:10: fatal error: ../lib/math/modpow.hpp: No such file or directory
    2 | #include "../lib/math/modpow.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
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;


#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define pb push_back
#define pii pair<int,int>
#define pf push_front
#define mp make_pair
#define vi vector<int>
#define vip vector<pair<int,int> >
#define ff first
#define ss second
#define int long long
#define mod 1000000007
#define BIG 998244353
#define s(t) scanf("%lld",&t)
#define p(t) printf("%lld\n",t)
#define mii map<int,int>
#define MSET(table,i) memset(table, i, sizeof(table))
#define endl '\n'
#define tc int t;cin>>t;while(t--)
#define pi  3.1415926358
#define bits(x) __builtin_popcount(x)
#define minimum(a,n) min_element(a,a+n)-a
#define maximum(a,n) max_element(a,a+n)-a
#define pqbig priority_queue<pii>
#define pqsmall priority_queue<int,vector<int>,greater<int> >
#define all(v) v.begin(),v.end()
#define sitr set<int>:: iterator
#define spitr set<pii>:: iterator
#define mitr map<int,int>:: iterator

int toint(const string &s) {stringstream ss; ss << s; int x; ss >> x; return x;}
string tostring ( int number ) {stringstream ss; ss << number; return ss.str();}


typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;


#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

const int N=1e5+5;
int dp[N];

int  powermod(int  x, int  y, int p )
{
    int res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res % p;
}

int32_t main() 
{
    fast;
    int n,k;cin>>n>>k;
    for(int i=k;i>=1;i--)
    	dp[i]=powermod(k/i,n,mod);


    for(int i=k;i>=1;i--)
    {
    	for(int j=2*i;j<=k;j+=i)
    		dp[i]-=dp[j],dp[i]+=mod,dp[i]%=mod;
    }

    int ans=0;
    for(int i=1;i<=k;i++)
    {
    	int num=i*dp[i];
    	num%=mod;
    	ans+=num,ans%=mod;
    }
    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>
#include "../lib/math/modpow.hpp"

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

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

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

  vector<ll> ans(k+1);
  for(ll i=1;i<=k;++i) {
    ans[i] = mod_pow<ll>(k/i, n, MOD);
  }
  //printv(ans);

  for(ll i=k-1;i>=1;--i) {
    for(ll j=2*i;j<=k;j+=i) {
      ans[i] = (ans[i] + MOD - ans[j]) % MOD;
    }
  }

  ll su = 0;
  for(ll i=1;i<=k;++i) {
    su += ans[i] * i % MOD;
    su %= MOD;
  }
  cout << su << 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> // Common file  
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less  
using namespace         std;
#define                 int long long
#define                 double long double
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<endl
#define                 endl '\n'
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 1014159
#define  vi vector<int>
#define  v  vector
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update> oset;
gp_hash_table<int, int> table;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash {
    int operator()(int x) const { return x ^ RANDOM; }
};



int freq;
int n;
int m[N];
int dpx[N];
int fac[N];
int k;

inline int mul(int a, int b) {return (a * 1ll * b) % MOD;}
inline int add(int a, int b) {a += b; if (a >= MOD)a -= MOD; a %= MOD; return a;}
inline int power(int a, int b) {int rt = 1; while (b > 0) {if (b & 1)rt = mul(rt, a); a = mul(a, a); b >>= 1;} return rt;}
inline int inv(int a) {return power(a, MOD - 2);}


int ncr(int n, int r)
{
    if (r > n)return 0;
    int x = fac[n] * inv(fac[n - r]);
    x %= MOD;
    x = x * inv(fac[r]);
    x %= MOD;
    return x;
}

int dp[N];

void check()
{

    rfor(i, n, 1)
    {

        dp[i] = power(dpx[i], k);
        for (int j = 2 * i ; j <= n ; j += i)
        {
            dp[i] = dp[i] - dp[j] + MOD;
            dp[i] %= MOD;
        }
    }
}




void solve()
{
    cin >> k >> n;
    forn(i, 1, n)
    {
        int a;
        a = i;
        m[a]++;
    }
    n = 0;
    forn(i, 0, N - 1)
    {
        n += m[i];
    }
    //cout << n << "\n";
    //dpx[1] = n;

    forn(i, 1, N - 1)
    {
        for (int j = i ; j < N ; j += i)
            dpx[i] += m[j];
    }





    check();

    int ans = 0;
    forn(i, 1, n)
    {
        //cout << dp[i] << " ";
        ans = add(ans, mul(dp[i], i));
    }
    //nl;
    cout << ans;



}


signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    //cin>>t;
    fac[0] = 1;
    forn(i, 1, N - 1)fac[i] = (fac[i - 1] * i) % MOD;
    while (t--)
    {
        solve();
        nl;
    }



    return 0;

}

//       g++ -g c.cpp ; ./a.out


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

//#include<bits\stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<string>
#include<ctime>
#include<cmath>
#include<cctype>
#include<cstdlib>
#include<queue>
#include<deque>
#include<stack>
#include<vector>
#include<algorithm>
#include<utility>
#include<bitset>
#include<set>
#include<map>
#define ll long long
#define db double
#define INF 2000000000
#define inf 10000000000000000ll
#define ldb long double
#define pb push_back
#define get(x) x=read()
#define gt(x) scanf("%d",&x)
#define put(x) printf("%d\n",x)
#define putl(x) printf("%lld\n",x)
#define gc(a) scanf("%s",a+1)
#define rep(p,n,i) for(RE ll i=p;i<=n;++i)
#define go(x) for(ll i=lin[x],tn=ver[i];i;tn=ver[i=nex[i]])
#define fep(n,p,i) for(RE ll i=n;i>=p;--i)
#define pii pair<ll,ll> 
#define mk make_pair
#define RE register
#define P 1000000007
#define S second
#define gf(x) scanf("%lf",&x)
#define pf(x) ((x)*(x))
#define ull unsigned long long
#define S second
#define F first
#define l(p) t[p].l
#define r(p) t[p].r
#define sum(p) t[p].sum
#define tag(p) t[p].tag
#define zz p<<1
#define yy p<<1|1
#define mod 1000000007
using namespace std;
char buf[1<<15],*fs,*ft;
inline char getc()
{
    return (fs==ft&&(ft=(fs=buf)+fread(buf,1,1<<15,stdin),fs==ft))?0:*fs++;
}
inline ll read()
{
    RE ll x=0,f=1;char ch=getc();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getc();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getc();}
    return x*f;
}
const ll MAXN=100010;
ll n,k,ans;
ll f[MAXN],c[MAXN];
inline ll ksm(ll b,ll p)
{
	ll cnt=1;
	while(p)
	{
		if(p&1)cnt=cnt*b%mod;
		p=p>>1;b=b*b%mod;
	}
	return cnt;
}
signed main()
{
	//freopen("1.in","r",stdin);
	get(n);get(k);
	fep(k,1,i)
	{
		ll ww=k/i;
		f[i]=ksm(ww,n);
		for(int j=i+i;j<=k;j+=i)f[i]=(f[i]-f[j])%mod;
		ans=(ans+f[i]*i)%mod;
	}
	putl((ans+mod)%mod);
	return 0;
}


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

#include <bits/stdc++.h>
#define RI register int
typedef long long LL;

#define FILEIO(name) freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);

using namespace std;

int const MAXN = 1e5 + 5, mod = 1e9 + 7;
int f[MAXN];

inline int qpow(int a, int k) {
  int re = 1;
  for (; k; k >>= 1, a = a * a % mod)
    if (k & 1) re = re * a % mod;
  return re;
}

signed main() {
  
#ifdef LOCAL
  FILEIO("a");
#endif

  int n, k; cin >> n >> k;
  for (RI i = k; i; --i) {
    f[i] = qpow(k / i, n);
    for (RI j = i + i; j <= k; j += i)
      f[i] = (f[i] - f[j] + mod) % mod;
  }
  int ans = 0;
  for (RI i = 1; i <= k; ++i)
    ans = (ans + f[i] * i % mod) % mod;
  cout << ans;

  return 0;
}

// created by Daniel yuan


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
int mod = 1e9 + 7;
int const maxn = 1e5 + 5;
int dp[maxn];

int st(int x, int y) {
    if (y == 0) return 1;
    if (y % 2 == 0) {
        int c = st(x, y / 2);
        return c * c % mod;
    }
    return x * st(x, y - 1) % mod;
}

main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k, ans = 0;
    cin >> n >> k;
    for (int i = k; i >= 1; --i) {
        int cnt = 1 + (k - i) / i;
        int goal = st(cnt, n);
        for (int j = 2 * i; j <= k; j += i) {
            goal -= dp[j];
            if (goal < 0) goal += mod;
        }
        ans += goal * i;
        ans %= mod;
        dp[i] = goal;
    }
    cout << ans << '\n';
    return 0;
}



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

#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000
#define bpc(x) __builtin_parityll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

ll powa(ll a, ll b, ll c)
{
    a%=c;
    if(a<0)
	a+=c;
    ll res = 1;
    while(b>0)
    {
        if(b&1)
            res*=a, res%=c;
        a*=a, a%=c;
        b>>=1;
    }
    return res;
}
 
#define N 200005
 
ll fact[N];
ll ifact[N];
 
ll ncr(ll n, ll r)
{
    if(r>n)
        return 0;
    ll ans = fact[n];
    ans*=ifact[r];
    ans%=mod;
    ans*=ifact[n-r];
    ans%=mod;
    return ans;
}

int main()
{
   FAST/**/
   
   fact[0] = 1;
   for(ll i=1;i<N;i++)
        fact[i] = fact[i-1]*i, fact[i]%=mod;
   for(ll i=0;i<N;i++)
        ifact[i] = powa(fact[i],mod-2,mod);
   
   ll n,k;
   cin>>n>>k;
   
   ll hold[k+1];
   memset(hold,0,sizeof(hold));
   for(ll i=1;i<=k;i++)
        hold[i] = k/i;
   ll dp[k+1];
   memset(dp,0,sizeof(dp));
   for(ll i=k;i>0;i--)
   {
        dp[i] = powa(hold[i],n,mod);
        for(ll j = 2*i;j<=k;j+=i)
            dp[i] = (dp[i]+mod-dp[j])%mod;
   }
   
   ll ans = 0;
   for(ll i=1;i<=k;i++)
   {
       ans+=(i*dp[i])%mod;
       ans%=mod;
   }
   cout<<ans;
   
   return 0;        
}  
   

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

#include<bits/stdc++.h>
using namespace std;
#define MN 200005
#define LL long long
#define mp make_pair
#define fir first
#define sec second
#define pii pair<int,int>
inline void chkmax(int &a,int b){if(a<b)a=b;}
inline void chkmin(int &a,int b){if(a>b)a=b;}
inline int read(){
	   int a=0,fh=1;char c=getchar();
	   while(c>'9'||c<'0'){if(c=='-')fh=-1;c=getchar();}
	   while('0'<=c&&c<='9'){
		   a=a*10+c-48;
		   c=getchar();
	   }
	   return a*fh;
}
#define Mod 1000000007
LL ksm(int a,int x){
	LL ans=1,w=a;
	while(x){
		if(x&1)ans=ans*w%Mod;
		x>>=1;
		w=w*w%Mod;
	}
	return ans;
}
int n,k;
LL f[MN],ans;
int main(){
	n=read();k=read();
	for(int i=k;i;--i){
		f[i]=ksm(k/i,n);
		for(int j=i*2;j<=k;j+=i)
			f[i]=(f[i]-f[j]+Mod)%Mod;
		ans+=(LL)f[i]*i%Mod;
	}
	printf("%lld\n",ans%Mod);
	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

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<ll, ll>;
using vi = vector<ll>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 1<<18, mod = 1e9 + 7, lg = 19;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll r[maxn], n, k;
ll bp(ll a, ll p) {
	ll r = 1;
	while(p) {
		if(p&1) r = (r*a)%mod;
		p>>=1, a = a*a%mod;
	}
	return r;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> k;
	for(int i = 1; i <= k; i++) {
		r[i] = bp(k/i, n);
	}
	ll ans = 0;
	for(int i = k; i; i--) {
		for(int j = i+i; j <= k; j+=i)
			r[i] = (mod+r[i]-r[j])%mod;
		ans = (ans + r[i]*i)%mod;
	}
	cout << ans;
	return 0;
}


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

#include<bits/stdc++.h>
#define god dimasi5eks
#pragma GCC optimize("O3")
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define mod 1000000007
#define dancila 3.14159265359
#define eps 1e-9

using namespace std;

typedef long long ll;


int add(int a, int b)
{
    int x = a+b;
    if(x >= mod)
        x -= mod;
    if(x < 0)
        x += mod;
    return x;
}
ll mul(ll a, ll b)
{
    return (a*b) % mod;
}

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

ll cnt[100005];
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k;
    cin >> n >> k;
    cnt[k] = 1;
    ll ans = k;
    for(int i = k-1; i >= 1; --i)
    {
        int rp = k/i;
        cnt[i] = pw(rp, n);
        for(int j = i+i; j <= k; j += i)
        {
            cnt[i] = cnt[i] + mod - cnt[j];
            if(cnt[i] >= mod)
                cnt[i] -= mod;
        }
        ans += 1LL * cnt[i] * i;
        ans %= mod;
    }
    cout << ans;
    return 0;
}


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

#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=1e6,mod=1e9+7;
int big(int b,int p)
{
  int r=1;
  while(p)
  {
    if(p&1)r=(1LL*r*b)%mod;
    b=(1LL*b*b)%mod;p/=2;
  }
  return r;
}
long cl[N+2];
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int n,k;cin>>n>>k;

  for(int i=1;i<=k;i++)
    cl[i]=big((k/i),n);
  for(int i=k;i>=1;i--)
  {
    for(int j=i+i;j<=k;j+=i)
      cl[i]=(cl[i]-cl[j]+mod)%mod;
  }
  long ans=0;
  for(int i=1;i<=k;i++)
    ans=(ans+cl[i]*i)%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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll pow(ll x,ll y){
  if(y==0) return 1;
  ll res=pow(x,y/2);
  res*=res;
  res%=mod;
  if(y%2==1) res*=x;
  return res%mod;
}
ll ans[100005]={0};
int main(){
  ll n,k;
  cin>>n>>k;
  ll res=0;
  for(ll m=k;m>=1;m--){
    ll a1=pow(k/m,n);
    for(ll i=2*m;i<=k;i+=m){
      a1-=ans[i];
      a1+=mod;
      a1%=mod;
    }
    ans[m]=a1;
    res+=a1*m;
    res%=mod;
  }
  cout<<res<<endl;
}


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

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr long double EPS = 1e-8;

long long int N, M, K, L, R, H, W;
//int N, M, K, L, R, H, W;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

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

	cin >> N >> K;
	vector<long long int>num(K + 1);
	long long int ans = 0;
	for (int i = K; i > 0; i--) {
		long long int add = power(K/i, N, MOD);
		for (int j = i * 2; j <= K; j += i) {
			add += MOD - num[j];
			add %= MOD;
		}
		num[i] = add;
		ans += add * i;
		ans %= MOD;
	}
	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>
using namespace std;

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)
#define chmax(x,y) x = max(x,y)
// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

ll dp[200005][4];

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    vector<ll> A(N);
    REP(i, N){
        cin >> A[i];
    }
    
    // 奇数なら2個偶数なら1個入れられる
    ll k = 1 + N%2;

    // dpテーブルの初期化
    REP(i, N){
        REP(j, k+1){
            dp[i][j] = -LINF;
        }
    }
    dp[0][0] = 0;

    REP(i,n) {
        REP(j,k+1) {
        chmax(dp[i+1][j+1], dp[i][j]);
        ll now = dp[i][j];
        if ((i+j)%2 == 0) now += a[i];
        chmax(dp[i+1][j], now);
        }
    }
    ll ans = dp[N][k];
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:11: error: 'n' was not declared in this scope
   63 |     REP(i,n) {
      |           ^
a.cc:9:37: note: in definition of macro 'REP'
    9 | #define REP(i,n) for(ll i=0; i<(ll)(n); ++i)
      |                                     ^
a.cc:67:34: error: 'a' was not declared in this scope
   67 |         if ((i+j)%2 == 0) now += a[i];
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

ll dp[200005][4]; // dp[i][j] := i番目まで見てj個余分なXを入れたときのmax


int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    int k = 1 + n % 2;
    rep(i,n+1)rep(j,k+1)dp[i][j] = -1e15;
    dp[0][0] = 0;
    rep(i,n){
        rep(j,k+1){
            // x を一個挿入する
            chmax(dp[i+1][j+1],dp[i][j]);

            // 余計なxを入れずにox列の通りに次の数を当てはめる
            ll now = dp[i][j];　// 現在までのmax
            if( (i+j)%2 == 0 ) now += a[i]; // 現在地がoだったら加算する
            chmax(dp[i+1][j],now); // i+1番目まで見てxをj個入れた時の値を更新する
        }
    }
    ll ans = dp[n][k];
    cout << ans << endl;
}

Compiler output:
a.cc:37:31: error: extended character 　 is not valid in an identifier
   37 |             ll now = dp[i][j];　// 現在までのmax
      |                               ^
a.cc: In function 'int main()':
a.cc:37:31: error: '\U00003000' was not declared in this scope
   37 |             ll now = dp[i][j];　// 現在までのmax
      |                               ^~
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<ll,ll>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
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;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(){
  ll N,ans=-INF;
  cin>>N;
  ll A[N];
  REP(i,N) cin>>A[i];
  
  if(N%2==0){
    ans=0;
    REP(i,N/2) ans+=A[i*2];
    REP(i,N/2){
      cnt=cnt-A[N-2-i*2]+A[N-1-i*2];
      chmax(ans,cnt);
    }
  }
  else{
    ll DP[N/2][3];
    REP(i,N/2){
      REP(j,3){
        DP[i][j]=-INF;
      }
    }
    
    DP[0][0]=A[0];
    DP[0][1]=A[1];
    DP[0][2]=A[2];
    RREP(i,N/2-1){
      chmax(DP[i][0],DP[i-1][0]+A[i*2]);
      chmax(DP[i][1],DP[i-1][0]+A[i*2+1]);
      chmax(DP[i][1],DP[i-1][1]+A[i*2+1]);
      chmax(DP[i][2],DP[i-1][0]+A[i*2+2]);
      chmax(DP[i][2],DP[i-1][1]+A[i*2+2]);
      chmax(DP[i][2],DP[i-1][2]+A[i*2+2]);
    }
    
    chmax(ans,DP[N/2-1][0]);
    chmax(ans,DP[N/2-1][1]);
    chmax(ans,DP[N/2-1][2]);
  }
  co(ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   80 |       cnt=cnt-A[N-2-i*2]+A[N-1-i*2];
      |       ^~~
      |       int
Language: C++

#include <stdio.h>

int bias = 10;
long long dp[bias*2+1][2],nxt[bias*2+1][2];

void mx(long long &a, long long b)
{
	if (a < b) a = b;
}

int main()
{
  for (int i=0;i<=bias*2;i++) dp[i][0] = dp[i][1] = -1e18; dp[bias][0] = 0;
  
  int n; scanf ("%d",&n);
  for (int k=0;k<n;k++){
	int x; scanf ("%d",&x);
  for (int i=0;i<=bias*2;i++) nxt[i][0] = nxt[i][1] = -1e18;
    for (int i=0;i<=bias*2;i++){
mx(nxt[i][0],dp[i][0]);
mx(nxt[i][0],dp[i][1]);
mx(nxt[i+2][1],dp[i][0]+x);
    }
  for (int i=1;i<=bias*2;i++){
    dp[i-1][0] = nxt[i][0];
    dp[i-1][1] = nxt[i][1];
  }
    dp[bias*2][0] = dp[bias*2][1] = -1e18;
  }
  
  int last = (n / 2) * 2 - n + bias;
  long long ans = -1e18;
  mx(ans,dp[last][0]);
  mx(ans,dp[last][1]);
  printf ("%lld\n",ans);
return 0;
}

Compiler output:
a.cc:4:20: error: size of array 'dp' is not an integral constant-expression
    4 | long long dp[bias*2+1][2],nxt[bias*2+1][2];
      |              ~~~~~~^~
a.cc:4:37: error: size of array 'nxt' is not an integral constant-expression
    4 | long long dp[bias*2+1][2],nxt[bias*2+1][2];
      |                               ~~~~~~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define P pair<ll,ll>
#define Graph vector<vector<ll>>
#define INF (1ll<<60)
#define mod 1000000007
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;} return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;} return false;}

int main(){
	ll n;cin>>n;
	vector<ll> a(n);
	rep(i,n) cin>>a[i];

	if(n==2){
		cout<<max(a[0],a[1])<<endl;
	}

	//nが偶数の時
	if(n%2==0 && n!=2){
		ll dp0[n+10],dp1[n+10],which=max(a[n-1],a[n-2]),MAX=-INF;
		rep(i,n+10) dp0[i]=dp1[i]=-INF;
		dp0[0]=a[0];
		dp1[1]=a[1];

		//0start
		for(ll i=0;i<n-2;i++){
			if(i+2<n-2){
				if(dp0[i]==-INF) continue;
				chmax(dp0[i+2],dp0[i]+a[i+2]);
				MAX=dp0[i+2];
			}
		}
		MAX+=which;

		//1start
		for(ll i=1;i<n;i++){
			if(i+2<n){
				if(dp1[i]==-INF) continue;
				chmax(dp1[i+2],dp1[i]+a[i+2]);
			}
		}
		MAX=max(MAX,dp1[n-1]);

		cout<<MAX<<endl;
	}

	//nが奇数の時
	if(n%2==1){
		ll dp0[n+10][3],dp1[n+10][2],dp2[n+10],MAX=-INF;
		rep(i,n+10) rep(j,3) dp0[i][j]=-INF;
		rep(i,n+10) rep(j,2) dp1[i][j]=-INF;
		rep(i,n+10) dp2[i]=-INF;

		dp0[0][0]=a[0];
		dp1[1][0]=a[1];
		dp2[2]=a[2];

		//2start
		for(ll i=2;i<n;i++){
			if(dp2[i]==-INF) continue;
			if(i+2<n) chmax(dp2[i+2],dp2[i]+a[i+2]);
		}
		MAX=max(MAX,dp2[n-1]);
		
		//1start
		for(ll i=1;i<n;i++){
			for(ll j=0;j<2;j++){//j:2個飛ばしを使った回数(1回しか使ってはならない)
				if(dp1[i]==-INF) continue;
				if(i+2<n) chmax(dp1[i+2][j],dp1[i][j]+a[i+2]);
				if(i+3<n && j+1<2) chmax(dp1[i+3][j+1],dp1[i][j]+a[i+3]);
			}
		}
		MAX=max(MAX,max(dp1[n-2][0],dp1[n-1][1]));
		
		//0start
		for(ll i=0;i<n;i++){
			for(ll j=0;j<3;j++){//j:2個飛ばしは2回まで、3個飛ばしは1回まで
				if(dp0[i]==-INF) continue;
				if(i+2<n) chmax(dp0[i+2][j],dp0[i][j]+a[i+2]);
				if(i+3<n && j+1<3) chmax(dp0[i+3][j+1],dp0[i][j]+a[i+3]);
				if(i+4<n && j+2<3) chmax(dp0[i+4][j+2],dp0[i][j]+a[i+4]);
			}
		}
		MAX=max(MAX,max(dp0[n-3][0],max(dp0[n-2][1],dp0[n-1][2])));
	
		cout<<MAX<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   71 |                                 if(dp1[i]==-INF) continue;
      |                                          ^
a.cc:81:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   81 |                                 if(dp0[i]==-INF) continue;
      |                                          ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

int main() {

    size_t N;
    cin >> N;
    vector<size_t> a(N + 1);
    vector<size_t> dp(N + 1, -10000);
    for (size_t i = 1; i <= N; ++i) cin >> a[i];

    dp[1] = a[1];
    dp[2] = a[2];
    for (size_t i = 2; i <= N; ++i) {
        dp[i] = max(dp[i], max(dp[i - 1], dp[i - 2] + a[i]));
    }
    
    cout << max(0ull, dp[N]);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: no matching function for call to 'max(long long unsigned int, __gnu_cxx::__alloc_traits<std::allocator<long unsigned int>, long unsigned int>::value_type&)'
   22 |     cout << max(0ull, dp[N]);
      |             ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and '__gnu_cxx::__alloc_traits<std::allocator<long unsigned int>, long unsigned int>::value_type' {aka 'long unsigned int'})
   22 |     cout << max(0ull, dp[N]);
      |             ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   22 |     cout << max(0ull, dp[N]);
      |             ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef long double ld;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

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

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    ll N = in<ll>();
    vector<ll> eve(N+1/2+1);
    vector<ll> odd(N/2+1);//累積
    vector<ll> eves(N+1/2);
    vector<ll> odds(N/2);
    REP(i,N){
        if(i %2 == 0){
            ll tmp = in<ll>();
            eve[i/2+1] = eve[i/2]+tmp;
            eves[i/2] = tmp;
        }else{
            ll tmp = in<ll>();
            odd[i/2+1] = odd[i/2]+tmp;
            odds[i/2] = tmp;
        }
    }
    if(N %2 == 0){
        ll answer = odd[N/2]-odd[0]+eve[0];
        REP(i,N/2+1){
            chmax(answer,odd[N/2]-odd[i]+eve[i]);
        }
        cout << answer << "\n";
    }else{
        ll max0 = 0;
        ll max1 = 0;
        ll max2 = 0;
        REP(i,N/2){
            ll max0b = max0;
            ll max1b = max1;
            ll max2b = max2;
            max0 = max0b+eves[i];
            max1 = max(max1b + odds[i],max0b + odds[i]);
            max2 = max({max0b + eves[i+1],max1b + eves[i+1],max2b + eves[i+1]});
        }
        cout << max({max0,max1,max2}) << "\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:12: error: 'in' was not declared in this scope; did you mean 'yn'?
   36 |     ll N = in<ll>();
      |            ^~
      |            yn
a.cc:36:17: error: expected primary-expression before '>' token
   36 |     ll N = in<ll>();
      |                 ^
a.cc:36:19: error: expected primary-expression before ')' token
   36 |     ll N = in<ll>();
      |                   ^
a.cc:43:27: error: expected primary-expression before '>' token
   43 |             ll tmp = in<ll>();
      |                           ^
a.cc:43:29: error: expected primary-expression before ')' token
   43 |             ll tmp = in<ll>();
      |                             ^
a.cc:47:27: error: expected primary-expression before '>' token
   47 |             ll tmp = in<ll>();
      |                           ^
a.cc:47:29: error: expected primary-expression before ')' token
   47 |             ll tmp = in<ll>();
      |                             ^
Language: C++

#include<iostream>
#include<algorithm>
#include <string>
#include <cstring>
#include<climits>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;
int n;
ll a[200001];
ll d[200001][3];
ll go(int x, int y) { // x까지 왔을 때 거를 수 있는 횟수가 y
	if (x >= n - y) {
		return 0;
	}
	ll &ret = d[x][y];
	if (ret != -1)return ret;
	ret = 0;
	ret = go(x + 2, y) + a[x];
	if (y > 0) {
		ret = max(ret, go(x + 1, y - 1));
		ret = max(ret, go(x + 3, y - 1) + a[x]);
	}
	if (y > 1) {
		ret = max(ret, go(x + 4, y - 2) + a[x]);
	}
	return ret;
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0); cout.tie(NULL);
	cin >> n;
	for (int i = 0; i < n; i++) { cin >> a[i]; }
	memset(d, -1, sizeof(d));
	if (n & 1) {
		cout << go(0, 2) << '\n';
	}
	else {
		cout << go(0, 1) << '\n';
	}


}#include<iostream>
#include<algorithm>
#include <string>
#include <cstring>
#include<climits>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef long long ll;
int n;
ll a[200001];
ll d[200001][3];
ll go(int x, int y) { // x까지 왔을 때 거를 수 있는 횟수가 y
	if (x >= n - y) {
		return 0;
	}
	ll &ret = d[x][y];
	if (ret != -1)return ret;
	ret = 0;
	ret = go(x + 2, y) + a[x];
	if (y > 0) {
		ret = max(ret, go(x + 1, y - 1));
		ret = max(ret, go(x + 3, y - 1) + a[x]);
	}
	if (y > 1) {
		ret = max(ret, go(x + 4, y - 2) + a[x]);
	}
	return ret;
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0); cout.tie(NULL);
	cin >> n;
	for (int i = 0; i < n; i++) { cin >> a[i]; }
	memset(d, -1, sizeof(d));
	if (n & 1) {
		cout << go(0, 2) << '\n';
	}
	else {
		cout << go(0, 1) << '\n';
	}


}

Compiler output:
a.cc:47:2: error: stray '#' in program
   47 | }#include<iostream>
      |  ^
a.cc:47:3: error: 'include' does not name a type
   47 | }#include<iostream>
      |   ^~~~~~~
a.cc:59:5: error: redefinition of 'int n'
   59 | int n;
      |     ^
a.cc:13:5: note: 'int n' previously declared here
   13 | int n;
      |     ^
a.cc:60:4: error: redefinition of 'll a [200001]'
   60 | ll a[200001];
      |    ^
a.cc:14:4: note: 'll a [200001]' previously declared here
   14 | ll a[200001];
      |    ^
a.cc:61:4: error: redefinition of 'll d [200001][3]'
   61 | ll d[200001][3];
      |    ^
a.cc:15:4: note: 'll d [200001][3]' previously declared here
   15 | ll d[200001][3];
      |    ^
a.cc:62:4: error: redefinition of 'll go(int, int)'
   62 | ll go(int x, int y) { // x까지 왔을 때 거를 수 있는 횟수가 y
      |    ^~
a.cc:16:4: note: 'll go(int, int)' previously defined here
   16 | ll go(int x, int y) { // x까지 왔을 때 거를 수 있는 횟수가 y
      |    ^~
a.cc:80:5: error: redefinition of 'int main()'
   80 | int main() {
      |     ^~~~
a.cc:34:5: note: 'int main()' previously defined here
   34 | int main() {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sum(ll n,ll a[],ll dp[])
{
	if(dp[n]!=-1){return dp[n];}
	if(n==0)
	{
		dp[n]=a[n];
		return a[n];
	}
	if(n==1){return dp[n]=max(a[0],a[1]);}
	return dp[n]=max(a[n]+sum(n-2,a,dp),sum(n-1,a,dp));
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	ll n;
	cin>>n;
		ll a[n];ll dp[n+1];
		for(int i=0;i<=n;i++){dp[i]=-1;}
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		ll ans=sum(n-1,a,dp);
		cout<<ans;
	}
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sum(ll n,ll a[],ll dp[])
{
	if(dp[n]!=-1){return dp[n];}
	if(n==0)
	{
		dp[n]=a[n];
		return a[n];
	}
	if(n==1){return dp[n]=max(a[0],a[1]);}
	return dp[n]=max(a[n]+sum(n-2,a,dp),sum(n-1,a,dp));
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	ll n;
	cin>>n;
		ll a[n];ll dp[n+1];
		for(int i=0;i<=n;i++){dp[i]=-1;}
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		ll ans=sum(n-1,a,dp);
		cout<<ans;
	
}


Compiler output:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
a.cc:34:4: error: redefinition of 'll sum(ll, ll*, ll*)'
   34 | ll sum(ll n,ll a[],ll dp[])
      |    ^~~
a.cc:4:4: note: 'll sum(ll, ll*, ll*)' previously defined here
    4 | ll sum(ll n,ll a[],ll dp[])
      |    ^~~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main()
      |     ^~~~
a.cc:15:5: note: 'int main()' previously defined here
   15 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll sum(ll n,ll a[],ll dp[])
{
	if(dp[n]!=-1){return dp[n];}
	if(n==0)
	{
		dp[n]=a[n];
		return a[n];
	}
	if(n==1){return dp[n]=max(a[0],a[1]);}
	return dp[n]=max(a[n]+sum(n-2,a,dp),sum(n-1,a,dp));
}
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	ll n;
	cin>>n;
		ll a[n];ll dp[n+1];
		for(int i=0;i<=n;i++){dp[i]=-1;}
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		ll ans=sum(n-1,a,dp);
		cout<<ans;
	}
}


Compiler output:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
long long n;
long long a[200003];
long long dp[200003];
long long sumb[200003];
long long ans=-2e18;
long long sum;
long long su; 
int main(){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	dp[1]=a[1];
	dp[2]=a[2];
	sumb[n]=a[n];
	sumb[n-1]=a[n-1];
	for(int i=3;i<=n;i++) dp[i]=dp[i-2]+a[i];
	for(int i=n-2;i>=1;i--) sumb[i]=sumb[i+2]+a[i];
	sum=dp[n];
	if(n%2==0){
		ans=max(dp[n-1],dp[n]);
		for(int i=1;i<=n;i+=2) ans=max(ans,dp[i]+sumbi+3]);
		cout<<ans<<endl;
		return 0;
	}
	for(int i=1;i<=n;i++){
		if(i%2==0) su+=a[i];
		else{
			su=max(su-a[i],-a[i]);
			ans=max(ans,sum+su);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:58: error: 'sumbi' was not declared in this scope; did you mean 'sumb'?
   22 |                 for(int i=1;i<=n;i+=2) ans=max(ans,dp[i]+sumbi+3]);
      |                                                          ^~~~~
      |                                                          sumb
Language: C++

#include<iostream>
using namespace std;
long long n;
long long a[200003];
long long dp[200003];
long long sumb[200003];
long long ans=-2e18;
long long sum;
long long su; 
int main){
	cin>>n;
	for(int i=1;i<=n;i++) cin>>a[i];
	dp[1]=a[1];
	dp[2]=a[2];
	sumb[n]=a[n];
	sumb[n-1]=a[n-1];
	for(int i=3;i<=n;i++) dp[i]=dp[i-2]+a[i];
	for(int i=n-2;i>=1;i--) sumb[i]=sumb[i+2]+a[i];
	sum=dp[n];
	if(n%2==0){
		ans=max(dp[n-1],dp[n]);
		for(int i=1;i<=n;i+=2) ans=max(ans,dp[i]+sumbi+3]);
		cout<<ans<<endl;
		return 0;
	}
	for(int i=1;i<=n;i++){
		if(i%2==0) su+=a[i];
		else{
			su=max(su-a[i],-a[i]);
			ans=max(ans,sum+su);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:10:9: error: expected initializer before ')' token
   10 | int main){
      |         ^
Language: C

#include <bits/stdc++.h>
#define endl '\n'
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define zy -2147382637
#define bql 2147483647
#define ll long long
#define ull unsigned long long
#define ld long double
#define il inline
#define sz(x) x.size()
#define maxn 100010
#define rp(i, l, r) for (int i = l; i <= r; i++)
#define rb(i, r, l) for (int i = r; i >= l; i--)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

using namespace std;
ll max(ll a,ll b){if(a>b)return a;else return b;}
ll min(ll a,ll b){if(a<b)return a;else return b;}
ll lowbit(ll x){return x&(-x);}
ll prime(ll x){
   if(x<=1)return false;
   for(int i=2;i<=int(sqrt(x));i++){
	   if(x%i==0)return false;
   }return true;
}
bool cmp(ll a,ll b){return a>b;}
ll gcd(ll a,ll b){ll r;while(b>0){r=a%b;a=b;b=r;}return a;}
ll powmod(ll a,ll b,ll mod) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
inline ll read() {
	char c = getchar(); ll w = 1; ll x = 0;
	while (!isdigit(c))
		(c == '-') && (w = -w), c = getchar();
	while (isdigit(c))
		x = (x << 1) + (x << 3) + (c ^ '0'), c = getchar();
	x *= w;
}
void fl(string name){
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
const ll MAXN=2e5+10;
ll sum[MAXN],dp[MAXN],a[MAXN],n;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=3;i<=n;i+=2){
		sum[i]=sum[i-2]+a[i];
	}
	for(int i=2;i<=n;i++){
		if(i%2==1){
			dp[i]=max(dp[i-1],dp[i-2]+a[i]);
		}
		else dp[i]=max(sum[i-1],dp[i-2]+a[i]);
	}
	cout<<dp[n]<<endl;
	return 0;

}

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

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

ll dp[200005][4];
ll INF = 1e+18;

int main(){
	ll n;
	cin >> n;
	vector<ll> a(n);
	rep(i,n) cin >> a[i];
	ll k = 1 + n % 2 ;
	rep(i,n+1)rep(j,k+1) dp[i][j] = -INF;
	dp[0][0] = 0;
	rep(i,n){
		rep(j,k+1){
			dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j]);
			ll now = dp[i][j];
			if((i+j)%2 == 0) now += a[i];
			dp[i+1][j] = max(dp[i+1][j], now);
		}
	}
	ll ans = dp[n][k];
	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.