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

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

template <typename _Ty>
_Ty bpow(_Ty a, int64_t n) {
    _Ty res = 1;
    for (; n > 0; n >>= 1) {
        if (n & 1) res *= a;
        a *= a;
    }
    return res;
}

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    ll N;
    cin >> N;

    ll N_tmp = N;
    unordered_map<ll, ll> factors;
    for (ll x = 2; x * x <= N; x++) {
        while (N % x == 0) {
            ++factors[x];
            N /= x;
        }
    }
    if (N > 1) {
        ++factors[N];
    }

    N = N_tmp;

    ll cnt = 0;
    for (const auto& p : factors) {
        ll a = N / bpow(p.first, p.second);
        if (a % p.first == 1) ++cnt;
    }

    ll N = N - 1;
    unordered_map<ll, ll> factors2;
    for (ll x = 2; x * x <= N; x++) {
        while (N % x == 0) {
            ++factors[x];
            N /= x;
        }
    }
    if (N > 1) {
        ++factors[N];
    }

    ll tmp = 1;
    for (const auto& p : factors2) {
        tmp *= p.second + 1;
    }

    cnt += tmp;

    cout << cnt << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:8: error: redeclaration of 'll N'
   59 |     ll N = N - 1;
      |        ^
a.cc:36:8: note: 'll N' previously declared here
   36 |     ll N;
      |        ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <bitset>

using namespace std;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define reppe(i,a,b) for(int i = (int)(a) ; i <= (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)
#define repme(i,a,b) for(int i = (int)(a) ; i >= (int)(b) ; --i)

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
int main() {
    ll N; cin >> N;
    ll res = 0;
    if (N % 2 == 1) {
        res += divisor(N-1);
        map<int64_t, int> m = prime_factor(N);
        for(auto x: m) {
            if (m.second < N/2) ++res;
        }
    } else {
        res += divisor(N);
        map<int64_t, int> m = prime_factor(N-1);
        for(auto x: m) {
            if (m.second < N/2) ++res;
        }
    }
    cout << res << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:13: error: no match for 'operator+=' (operand types are 'll' {aka 'long long int'} and 'std::vector<long long int>')
   48 |         res += divisor(N-1);
      |         ~~~~^~~~~~~~~~~~~~~
a.cc:51:19: error: 'class std::map<long int, int>' has no member named 'second'
   51 |             if (m.second < N/2) ++res;
      |                   ^~~~~~
a.cc:54:13: error: no match for 'operator+=' (operand types are 'll' {aka 'long long int'} and 'std::vector<long long int>')
   54 |         res += divisor(N);
      |         ~~~~^~~~~~~~~~~~~
a.cc:57:19: error: 'class std::map<long int, int>' has no member named 'second'
   57 |             if (m.second < N/2) ++res;
      |                   ^~~~~~
Language: C++

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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<(int)n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fill(a,v) memset(a,v,sizeof(a))
#define d1(a) cout << a << "\n"
#define d2(a,b) cout << a << " " << b << "\n"
#define d3(a,b,c) cout << a << " " << b << " " << c << "\n"
#define d4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << "\n"
#define fast ios:: sync_with_stdio(false),cin.tie(nullptr);

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;
bool fun(int n , int k){
	while(n >= k){
		while(n % k ==0)  n/=k;
		if(n >= k)  n%= k;
		else break;
	}
	return(n == 1);
}

int32_t main(){
	fast;
	int n;
	cin >> n;
	set<int>s;
	for(int i=2 ; i*i <= n ; i++){
		if(n % i == 0){
			if(fun(n , i))s.insert(i);
			if(fun(n , n/i))s.insert(n/i);
		}
	}
	int m = n - 1;
	for(int i=2 ; i*i <= m ; i++){
		if(m % i == 0){
			if(fun(n , i))s.insert(i);
			if(fun(n , m/i))s.insert(m/i);
		}
	}
	ans += 2;
	cout << sz(s);
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:57:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |         ans += 2;
      |         ^~~
      |         abs
Language: C++

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

// long long f(n, k)
// {
//     if (n % k == 0)
//     {
//         n /= k;
//     }
//     else
//     {
//         n -= k;
//     }
// }

// bool g(long long n, long long k)
// {
//     long long m = f(n, k);

// }

template <typename T, typename U>
vector<pair<T, U>> prime_factorization(T x)
{
    vector<pair<T, U>> ret;
    for (T i = 2; i * i < x; i++)
    {
        U count = 0;
        while (x % i == 0)
        {
            count++;
            x /= i;
        }
        if (count > 0)
        {
            ret.push_back(make_pair(i, count));
        }
    }
    if (x != 1)
    {
        ret.push_back(make_pair(x, 1));
    }
    return ret;
}

template <typename T, typename U>
T power(T x, U y)
{
    T ret;
    ret = 1;
    while (y > 0)
    {
        if ((y & 1) > 0)
        {
            ret *= x;
        }
        x *= x;
        y >>= 1;
    }
    return ret;
}

long long f(long long n)
{
    if (n == 1)
    {
        return 1;
    }
    vector<pair<long long, int>> prime = prime_factorization<long long, int>(n - 1);
    long long ans = 1;
    for (pair<long long, int> p : prime)
    {
        ans *= p.second + 1;
    }
    ans--;
    vector<long long> x = diva(prime);
    for (long long a : x)
    {
        long long m = n;
        while (m % a == 0)
        {
            m /= a;
        }
        if (m % a == 1)
        {

            ans++;
        }
    }
    return ans;
}

vector<long long> diva(vector<pair<long long, int>> prime)
{
    vector<long long> ret;
    ret.push_back(1);
    for (pair<long long, int> p : prime)
    {
        int n = ret.size();
        for (int i = 0; i < n; i++)
        {
            for (int j = 1; j <= p.second; j++)
            {
                ret.push_back(ret[i] * power(p.first, j));
            }
        }
    }
    return ret;
}

int main()
{
    long long N;
    cin >> N;
    cout << f(N) << endl;
    // vector<pair<long long, int>> prime = prime_factorization<long long, int>(N - 1);
    // long long ans = 1;
    // for (pair<long long, int> p : prime)
    // {
    //     ans *= p.second + 1;
    // }
    // ans--;
    // cout << ans << endl;
}


Compiler output:
a.cc: In function 'long long int f(long long int)':
a.cc:76:27: error: 'diva' was not declared in this scope; did you mean 'div'?
   76 |     vector<long long> x = diva(prime);
      |                           ^~~~
      |                           div
Language: C++

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

int64_t N;
int check(int64_t x){
  int64_t n=N;
  while(n>=x){
    if(n%x==0){
      n=x;
    }
    else n=n-x;
    if(n==1){
      return 1;
    }
  }
  return 0;
}

int main(){
  cin >> N;
  if(N==2){
    cout << 1 << endl;
    return 0;
  }
  if(N==3){
    cout << 2 << endl;
    return 0;
  }
  if(N==4){
    cout << 3 << endl;
    return 0;
  }
  int ans=2;
  for(int i=2;i<=N/2){
    if(check(i)==1){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:21: error: expected ';' before ')' token
   34 |   for(int i=2;i<=N/2){
      |                     ^
      |                     ;
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin >> n;
  ll res = 0;
  vector<ll> num;
  for(int i = 2;i <= sqrt(res);i++){
    if(n % i == 0)num.push_back(i);
  }
  sort(num.begin(),num.end());
  for(int i = 2;i <= pow(n,1/2);i++){
    if((double)pow(n,1/i) % 1 == 0)res++;
  }
  for(int i = 1;i <= sqrt(res - 1);i++){
    if((res - 1) % i == 0)res++;
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:27: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   21 |     if((double)pow(n,1/i) % 1 == 0)res++;
      |        ~~~~~~~~~~~~~~~~~~ ^ ~
      |        |                    |
      |        double               int
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;

typedef long long ll;

ll N;

map<ll, int> insu;
vector<ll> crt, nxt;

ll mpow(ll a, int b) {
	ll base = 1, kakeru = a;
	while (b > 0) {
		if (b & 1)base *= kakeru;
		kakeru *= kakeru;
		b >>= 1;
	}
	return base;
}

void soinsu(ll x) {
	for (ll i = 2; i * i <= x; i++) {
		int cnt = 0;
		while (x % i == 0)x /= i, cnt++;
		if (cnt != 0)insu[i] = cnt;
	}
	if (x != 1) {
		insu[x]++;
	}

	crt.push_back(1);
	for (auto it = insu.begin(); it != insu.end(); it++) {
		for (int i = 0; i < crt.size(); i++) {
			for (int j = 0; j <= (*it).second; j++) {
				nxt.push_back(crt[i] * mpow((*it).first, j));
			}
		}
		swap(crt, nxt);
		nxt.clear();
	}
}

int main() {
	cin >> N;
	if (N == 2) {
		cout << 1 << endl;
		return 0;
	}
	soinsu(N - 1);
	sort(crt.begin(), crt.end());

	ll cnt = 0;
	for (int i = 2; i * i <= N; i++) {
		ll cN = N;
		while (cN % i == 0)cN /= i;
		if (cN % i == 1)cnt++;
	}
	
	cout << cnt + crt.size() - (lower_bound(crt.begin(), crt.end(), sqrt(N)) - crt.begin())+ 1 << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:73: error: 'sqrt' was not declared in this scope
   63 |         cout << cnt + crt.size() - (lower_bound(crt.begin(), crt.end(), sqrt(N)) - crt.begin())+ 1 << endl;
      |                                                                         ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <numeric>
#include <map>
#include <iomanip>
#include <limits.h>
#include <cmath>

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = true;

int main(){

    ll N;
    cin >> N;

    ll ans = 0;
    map<ll, ll> m;
    // 一回でもkが入るパターン
    for(ll k = 2; k <= N; k++){       
        if(k * k > N) break;
        ll kn1 = k; 
        while (true)
        {
            if( N % kn1 == 0 ){
                ll ntmp = N / kn1;
                if( (ntmp - 1) % k == 0) {
                    //cout << k << endl;
                    ans ++;
                }
            }
            kn1 *= k;
            if( kn1 > N ) break;
        }
    }

    vector<bool> v(kmax, false);
    ll ans2 = 0;
    for(ll k = 1; k <= N; k++){
        if(k * k > N) break;
        if( (N - 1ll) % k == 0 ){
            ans += 2;
            //cout << k << endl;
        }
        if(k * k == N ) ans2 -= 1;
    }

    cout << ans + ans2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:20: error: 'kmax' was not declared in this scope; did you mean 'fmax'?
   43 |     vector<bool> v(kmax, false);
      |                    ^~~~
      |                    fmax
Language: C++

#include <bits/stdc++.h>

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

int main() {
source:
    ll n;
    cin >> n;
    set<ll> m;
    ll sq = sqrt(n);

    repd(i, 2, sq + 1) {
        if (n % i == 0) {
            m.insert(i);
            m.insert(n / i);
        }
        if ((n - 1) % i == 0) {
            m.insert(i);
            m.insert((n - 1) / i);
        }
    }

    m.insert(n - 1);
    m.insert(n);
    ll ans = 0;
    for (auto num : m) {
        ll num = *iter;
        ll temp = n;
        while (temp > 0) {
            if (temp % num == 0) {
                temp /= num;
            } else {
                temp %= num;
            }

            if (temp == 1) {
                ans++;
                break;
            } else if (temp < num) {
                if (temp < num) {
                    break;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:12: error: redeclaration of 'll num'
   35 |         ll num = *iter;
      |            ^~~
a.cc:34:15: note: 'long long int num' previously declared here
   34 |     for (auto num : m) {
      |               ^~~
a.cc:35:19: error: 'iter' was not declared in this scope
   35 |         ll num = *iter;
      |                   ^~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <numeric>
#include <random>
#include <bitset>
#include <chrono>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

#ifndef ONLINE_JUDGE
// #include "debug.h"
#else
// #define debug(...) 42
#endif

const int M = 2e5+5;
const int MD=1e9+7;


ll div(ll x)
{
	ll cnt=1;
	for(ll i=2;i*i<=x;i++){
		if(x%i==0){
			if(i==x/i) cnt++;
			else cnt+=2;
		}
	}
	return cnt;
}
int main() {
	fast_cin();
	ll n,ans=1,tmp;
	cin>>n;
	ans+=div(n-1);
	debug(ans);
	tmp=n;
	for(ll i=2;i*i<=n;i++){
		if(n%i) continue;
		ll mul=1;
		while(n%i==0)
		{
			n/=i;
			mul*=i;
		}
		ll xx=tmp/mul;
		if(xx%i==1) ans++;
	}
	if(n>1){
		if(tmp!=n){
			ll xx=tmp/n;
			if(xx%n==1) ans++;
		}
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:9: error: 'debug' was not declared in this scope
   57 |         debug(ans);
      |         ^~~~~
Language: C++

clude<bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define ff first
#define ss second
#define rep(i,a,n) for(int i=a;i<n;i++)
#define M 1000000007
ll power(ll x, ll y, ll p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {   if (y & 1)
        res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
int main()
{
   ll n;
   cin>>n;
   if(n==2)
   {
   	cout<<1;
   	return 0;
   }
   ll ans=2;
   for(ll i=2;i*i<=n;i++)
   {
   	  if(n%i==1)
   	  {
   	  	if(n/i!=i)
   	  	ans+=2;
   	  	else
   	  	ans++;
   	  }
   	  else if(n%i==0)
   	  {
   	      ll x=n;
			 while(x>=i&&x!=1)
			 {
			     if(x%i==0)
				 x/=i;
				 else
				 {
				    ll y=x/i;
					y=y*i;
					x-=y;
					if(x!=1)
					break;
				 }
			 }
				if(x==1)
				ans++;	
	  }
   }
   cout<<ans;
    
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude<bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:25:4: error: 'cin' was not declared in this scope
   25 |    cin>>n;
      |    ^~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout<<1;
      |         ^~~~
a.cc:61:4: error: 'cout' was not declared in this scope
   61 |    cout<<ans;
      |    ^~~~
Language: C++

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cout << *it << " = " << a << endl;
	err(++it, args...);
}
 
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int power (int a, int b = mod - 2)
{
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return res;
}
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	read(n);
	int sqr = sqrt(n + 4), cnt = 2;
	set <int> s;
	
	int ssq = sqr(n - 1);
	FOR (i, 2, ssq - 1)
	{
	    if ((n - 1) % i == 0) cnt += 2;
	}
	
	if ((n - 1) % ssq == 0) cnt++;
	
	
	FOR (i, 2, sqr)
	{
	    if (n % i == 0)
	    {
	        int t = i, icpy = i, x = (1e18)/icpy;
	        while (true)
	        {
	            if (t > x || (n % (t*i))) break;
	            t *= i;
	        }
	        
	        int cpy = n/t;
	        if (cpy % icpy == 1) s.insert(i);
	        
	        
	        
	        
	        
	        t = n/i, icpy = n/i, x = (1e18)/icpy;
	        while (true)
	        {
	            if (t > x || (n % (t*icpy))) break;
	            t *= icpy;
	        }
	        
	        cpy = n/t;
	        if (cpy % icpy == 1) s.insert(icpy);
	    }
	}
	
	cout << sz(s) + cnt;
}





















Compiler output:
a.cc: In function 'int main()':
a.cc:66:22: error: 'sqr' cannot be used as a function
   66 |         int ssq = sqr(n - 1);
      |                   ~~~^~~~~~~
Language: C++

#include <iostream>
#include <cstdint>
#include <unordered_map>
#include <algorithm>
#include <vector>

using i64 = std::int64_t;
using uint = std::uint32_t;

std::unordered_map<i64, int> primeFactor(i64 n) {
    std::unordered_map<i64, int> ret;
    for (i64 i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;

    return ret;
}

i64 exp(i64 x, i64 n) {
    i64 ret = 1;
    while (n != 0) {
        if (n % 2 == 1)
            ret *= x;

        x *= x;
        n /= 2;
    }

    return ret;
}

int main() {
	i64 n;
	std::cin >> n;

    i64 ans = 1;
    for (auto&& p : primeFactor(n - 1))
        ans *= p.second + 1;

    auto map = primeFactor(n);
    std::vector<std::pair<i64, int>> pfacts(map.begin(), map.end());

    if (map.size() == 1) {
        if (pfacts[0].second != 1) {
            for (int i = 1; i * i <= pfacts[0].second; ++i)
                if (pfacts[0].second % i == 0)
                    ++ans;
        }

        std::cout << ans << std::endl;
        return 0;
    }

    for (uint i = 1; i < (1 << map.size()); ++i) {
        i64 k = 1;
        int pow = 100000;
        for (int j = 0; j < map.size(); ++j) {
            if (((i >> j) & 1) == 1) {
                k *= pfacts[j].first;
                pow = std::min(pow, pfacts[j].second);
            }
        }

        i64 a = exp(k, pow);
        if (a == n)
            continue;

        for (int j = 1; j <= pow; ++j) {
            if (pow % j != 0)
                continue;

            if ((n / a - 1) % exp(k, j) == 0)
                ++ans;
        }
    }

    i64 t = sqrt(n);
    if (n == t * t)
        ++ans;

    std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:13: error: 'sqrt' was not declared in this scope
   82 |     i64 t = sqrt(n);
      |             ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int N;
  int K;
  int i = 0;
  int j = 0;
  scanf("%d", &N);
  j = N % K;
  for(K = 2; K <= N; ++K){
  	while(N > K){
    	switch(j)
          case '0':
      		N = N/K;
      		break;
      	  default:
          	N = N - K;
    }
    if(N = 1){
      i = i + 1;
    }
  }
  printf("%d", i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:11: error: 'default' label not within a switch statement
   16 |           default:
      |           ^~~~~~~
Language: C++

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


int main() {
  int64_t n;
  cin >> n;
  vector<int64_t> vec(1000000000000);
  vec[0]=1
  rep(i,1000000000000){
    a=i+1;
    vec[a*n-1]+=vec[i];
    vec[a+n-1]+=vec[i];
  }
  cout<< vec[n-1] << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected ';' before 'for'
   10 |   vec[0]=1
      |           ^
      |           ;
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   rep(i,1000000000000){
      |       ^
a.cc:3:35: note: in definition of macro 'rep'
    3 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |                                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forr(i,n) for(int i=n;i>=0;i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 +5;
using u64 = LL;
using u128 = LL;

void fio(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

LL po(LL a, LL n, LL m){
  if(n==0) return 1;
  LL an = po(a,n/2,m);
  an = (an*an)%m;
  if(n&1) return an*a%m;
  return an;
}

bool isprime(LL n, int iter=100) {
    if (n < 4)
        return n == 2 || n == 3;

    for (int i = 0; i < iter; i++) {
        LL a = 2 + rand() % (n - 3);
        if (po(a, n - 1, n) != 1)
            return false;
    }
    return true;
}

bool chk(LL i, LL n){
  while(n%i==0) n/=i;
  if(n==1) return 1;
  if(n%k==1) return 1;
   return 0;
}
int main(){
  fio();
  LL n; cin>>n;
  LL k = n-1;
  set<LL> s;
  for(LL i = 2;i*i<=k;i++){
    if(k%i==0 && chk(i,n)) s.insert(i);
    if(k%i==0 && chk(k/i,n))s.insert(k/i);
  }
  s.insert(k);
  for(LL i=2;i*i<=n;i++){
    if(n%i==0 && chk(i,n)) s.insert(i);
    if(n%i ==0 && chk(n/i,i)) s.insert(n/i);
  }
 // s.insert(2);
  s.insert(n);
//  for(auto i:s) cout<<i<<" ";
  //  cout<<endl;
  cout<<s.size()<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'bool chk(LL, LL)':
a.cc:44:8: error: 'k' was not declared in this scope
   44 |   if(n%k==1) return 1;
      |        ^
Language: C++

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

int main() {
    long long int n,k;
    cin>> n>>k ;
 int ans=0 ;
  for(int i=2; i<1000001; i++){
  if(n-1%i==0)
  ans++ ;
  }
  for(int i=0; i<1000001;i++){
  while(n%i==0){
  n= n%i
  }
  if(n==1)
   ans++ ;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ';' before '}' token
   14 |   n= n%i
      |         ^
      |         ;
   15 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forr(i,n) for(int i=n;i>=0;i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 +5;
using u64 = LL;
using u128 = LL;

void fio(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

LL po(LL a, LL n, LL m){
  if(n==0) return 1;
  LL an = po(a,n/2,m);
  an = (an*an)%m;
  if(n&1) return an*a%m;
  return an;
}

bool isprime(LL n, int iter=100) {
    if (n < 4)
        return n == 2 || n == 3;

    for (int i = 0; i < iter; i++) {
        LL a = 2 + rand() % (n - 3);
        if (po(a, n - 1, n) != 1)
            return false;
    }
    return true;
}

bool chk(LL i, LL n){
  while(n%i==0) n/=i;
  if(n==1) return 1;
  if(n%k==1) return 1;
   return 0;
}
int main(){
  fio();
  LL n; cin>>n;
  LL k = n-1;
  set<LL> s;
  for(LL i = 2;i*i<=k;i++){
    if(k%i==0) s.insert(i), s.insert(k/i);
  }
  s.insert(k);
  for(LL i=2;i*i<=n;i++){
    if(n%i==0 && chk(i,n)) s.insert(i);
  }
 // s.insert(2);
  s.insert(n);
//  for(auto i:s) cout<<i<<" ";
  //  cout<<endl;
  cout<<s.size()<<endl;
  return 0;
}



Compiler output:
a.cc: In function 'bool chk(LL, LL)':
a.cc:44:8: error: 'k' was not declared in this scope
   44 |   if(n%k==1) return 1;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define pii pair<int,int>
#define fi first
#define se second
#define mp(x,y) make_pair(x,y)
#define pb(x) pupsh_back(x)
int32_t main() {
   
   int N;
   cin>>N;
   int cnt=0;
   int i=2;
   set<int> ANS;
   for(i=2;i*i<N;i++)
   {
      // int cnt=0;
       int M=N;
       
       if(M%i!=0)
       continue;
       
       while(M%i==0)
       {
           M=M/i;
       }
       
       if(M==1)
       {
           //cout<<i<<" ";
          // cout<<"S";
           cnt++;
          // cout<<i<<" ";
       }
       else if(M%i==1)
       {
          // cout<<i<<" ";
          //  cout<<"Y";
            cnt++;
            //cout<<i<<" ";
            //cout<<N/i<<" ";
            //cout<<cnt;
       }
       
       //M=N;
   }
   
   if(i*i==N) cnt++;
   
   N--;
   
   for(i=2;i*i<N;i++)
   {
      // int cnt=0;
       int M=N;
       if(M%i==0)
       {
       cnt+=2;
      // cout<<i<<" "<<M/i<<" ";}
       
       //M=N;
   }
   
   if(i*i==N)
   {
       cnt++;
      // cout<<i<<" ";
   }
   
   
   
   
   cout<<cnt+2;
    return 0;
    
//    cout<<"Sum of x+y = " << z;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:79:2: error: expected '}' at end of input
   79 | }
      |  ^
a.cc:10:16: note: to match this '{'
   10 | int32_t main() {
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define sz(x) (int)x.size();
#define all(x) (x).begin(), (x).end()
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define rep(i, n) for(int i =0 ; i < n; ++i)
#define Rep(i,a,b) for(int i=a;i<=b;i++)
#define pii pair < int, int >
typedef vector<int> vi;
typedef  long long ll;
const int inf = int(1e9);
const int mod =1e9+7;
const int N = (int)2e5 + 5;

void solve(){
	ll n;
	cin>>n;
	for(int i=2;i<=n;i++){
		int x=n;
		while(true){
			if(x==1 || x<1)break;
			if(x%i==0){
				x/=i;
			}
			else{
				x-=i;
			}
		}
		if(x==1)cnt++;
	}
	cout<<cnt;

}
int main(){
	Red;
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:33:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |                 if(x==1)cnt++;
      |                         ^~~
      |                         int
a.cc:35:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   35 |         cout<<cnt;
      |               ^~~
      |               int
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int N;
  int K;
  int i = 0;
  scanf("%d", &N);
  for(K = 2; K <= N; ++K){
  	while(N > K){
    	if (N % K = 0){
          N = N/K;
        }
      	else{
          N = N - K;
        }
    }
    if(N = 1){
      i = i + 1;
    }
  }
  printf("%d", i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: lvalue required as left operand of assignment
   10 |         if (N % K = 0){
      |                   ^
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int N;
  int K;
  int i = 0;
  scanf("%d", &N);
  for(K = 2; K <= N; ++K){
  	while(N < K){
    	if (N % K = 0){
          N = N/K;
        }
      	else{
          N = N - K;
        }
    }
    if(N = 1){
      i = i + 1;
    }
  }
  printf("%d", i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: lvalue required as left operand of assignment
   10 |         if (N % K = 0){
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define pp pair<ll,ll>
#define vi vector<pair<pp,pp> >
#define pq_min priority_queue<ll,vector<ll>,greater<ll>>
#define pq_max priority_queue<ll>
#define f(i,a,b) for(ll i=a;i<b;i++)
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define fill(a,b) memset((a),(b),sizeof((a)))
#define ld long double
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef pair<pp,pp> ppll;
const ll mod=1e9+7;
ll lookup[101][501];

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

int main()
{
    fast;
    ll n;
    cin>>n;
    ll k=n;
    if(n==2) {cout<<"1";return 0;}
    if(n==3) {cout<<"2";return 0;}
    if(n==4) {cout<<"3";return 0;}
    if(n==5) {cout<<"3";return 0;}
    ll ans=2;
    for(ll i=2;i*i<=n;i++)
    {
        k=n;
        if(k%i == 0)
        {
            while(k%i==0)
            {
                k/=i;
            }
            if(k%i == 1) {ans++;}
            if(i*i!=n)
            {
                ll h=i;
                ll j=n/i;
                while(h%j==0)
                {
                    h/=j;
                }
                if(h%j == 1) {ans++;}
            }
        }
        else if(k%i==1) {ans += 2}
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:34: error: expected ';' before '}' token
   69 |         else if(k%i==1) {ans += 2}
      |                                  ^
      |                                  ;
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int N = 0;
  int K = 0;
  int i = 0;
  scanf("%d", &N);
  for(K = 2; K <= N; ++K){
  	while(N < K){
    	if (N % K = 0){
          N = N/K;
        }
      	else{
          N = N - K;
        }
    }
    if(N = 1){
      i = i + 1;
    }
  }
  printf("%d", i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:19: error: lvalue required as left operand of assignment
   10 |         if (N % K = 0){
      |                   ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
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;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void chey(){ cout <<"hey" <<endl; }


vector<pair<int,int>> pf;
map<int,int> dn,dn1;
ll res1 = 0;
ll N;

// 素因数分解O(√n)--------------------------------------------
template<class T> void prime_factor(int n, map<int,T> &res){
  for (int i=2; i*i<=n; i++){ while (n%i==0){ res[i]++; n/=i; } }
  if (n!=1) res[n]+=1;
}

void dfs(int i, int endi, ll number){
  if (i == endi){
    if (number == 1) return;
    // numberが条件を満たすかチェック
    ll tmp = N;
    while (tmp % number == 0) tmp /= number;
    tmp %= number;
    if (tmp == 1) res1++;
    return;
  }
  for (int d=0; d<=pf[i].second; d++){
    if (d > 0) number *= pf[i].first;
    dfs(i+1, endi, number);
  }
}

int main() {
  cin >>N
  ll test = N;
  int tmpres = 0;
  for (ll i=2; i<=test; i++){
    ll tmp = test;
    while (tmp % i == 0) tmp /= i;
    if (tmp % i == 1) tmpres++;
  }
  cout <<tmpres <<endl;
}

  // N = K か N = K+1 になれば最終的に1になる
  // N = N/K を行ってKの倍数 → Kの倍数でない、となることはある
  // N = N-K を行ってKの倍数でない → Kの倍数、となることはない
  /*
    N = K となるのは N が K のべき乗で表されるとき(Kで割りまくってKになる)
    N = K+1 となるのは色々あるが途中絶対に N-1 が K の倍数になる
  */
/*
// N-1を素因数分解して得られる約数全て(1以外)は条件を満たす
// じゃあ１回はkで割れるやつらはどうだろう
N = 2^3 * 3^2 = 72とかとする
K = 2...9, o
K = 3...8, x
K = 4...18, x
K = 6...2, x
K = 8...9, o
K = 9...8, x
K = 12...6, x
K = 18...4, x
K = 24...3, x
K = 36...2, x

Nを素因数分解して得られる
*/
/*
1 K   K^2    K^3
  K+1 (K+1)K (K+1)K^2
      2K+1   (2K+1)K
             3K+1
  
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:53:10: error: expected ';' before 'll'
   53 |   cin >>N
      |          ^
      |          ;
   54 |   ll test = N;
      |   ~~      
a.cc:56:19: error: 'test' was not declared in this scope
   56 |   for (ll i=2; i<=test; i++){
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main ( ) 
{
	int m,n;
	cin>>n>>m;
	if(n%m==0)
	{
		cout<<"0";
		return 0;
	} 
	else
	{
		if(n%m>=m/2)
		for(int i=1;i<=n;i++)
		{
			inffsjthjhhn>>a[i];
			else
			{
		dfg		cout<< 
		}
	}
}gyuiop

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: 'inffsjthjhhn' was not declared in this scope
   17 |                         inffsjthjhhn>>a[i];
      |                         ^~~~~~~~~~~~
a.cc:17:39: error: 'a' was not declared in this scope
   17 |                         inffsjthjhhn>>a[i];
      |                                       ^
a.cc:18:25: error: 'else' without a previous 'if'
   18 |                         else
      |                         ^~~~
a.cc:20:17: error: 'dfg' was not declared in this scope
   20 |                 dfg             cout<<
      |                 ^~~
a.cc:23:2: error: 'gyuiop' was not declared in this scope
   23 | }gyuiop
      |  ^~~~~~
a.cc:23:8: error: expected '}' at end of input
   23 | }gyuiop
      |        ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<bits/stdc++.h>
#include<tr1/unordered_set> 
using namespace std;
using namespace tr1;
long long n;
unordered_set<long long> s;
int main()
{
	cin>>n;
	s.insert(n-1);s.insert(n);
	for(int i=2;(long long)i*i<=n-1;i++)
	{
		if((n-1)%i==0)
		{
			s.insert(i);
			s.insert((n-1)/i);
			//cout<<i<<' '<<(n-1)/i<<endl;
		}
	}
	for(int i=2;(long long)i*i<=n-1;i++)
	{
		long long tmp=n;
		while(tmp%i==0)
			tmp/=i;
		if(tmp%i==1)
			s.insert(i);
	}
	cout<<s.size();
    return 0;
}

Compiler output:
a.cc:6:1: error: reference to 'unordered_set' is ambiguous
    6 | unordered_set<long long> s;
      | ^~~~~~~~~~~~~
In file included from /usr/include/c++/14/tr1/unordered_set:44,
                 from a.cc:2:
/usr/include/c++/14/tr1/unordered_set.h:173:11: note: candidates are: 'template<class _Value, class _Hash, class _Pred, class _Alloc> class std::tr1::unordered_set'
  173 |     class unordered_set
      |           ^~~~~~~~~~~~~
In file included from /usr/include/c++/14/unordered_set:41,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:189,
                 from a.cc:1:
/usr/include/c++/14/bits/unordered_set.h:104:11: note:                 'template<class _Value, class _Hash, class _Pred, class _Alloc> class std::unordered_set'
  104 |     class unordered_set
      |           ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 's' was not declared in this scope
   10 |         s.insert(n-1);s.insert(n);
      |         ^
Language: C++

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

constexpr int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}; 
constexpr int dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

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

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

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

void solver() {
    i64 N = input();
    vector< i64 > d = divisor(N);
    
    i64 ans = 0;
    ans += divisor(N - 1).size() - 1;

    for (auto m: d) {
        if (m == 1) continue;
        i64 n = N;
        
        while (n % m == 0) n /= m;
        if (n % m == 1) ans++;
    }
    
    cout << ans << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


Compiler output:
a.cc: In function 'void solver()':
a.cc:58:30: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   58 |     vector< i64 > d = divisor(N);
      |                       ~~~~~~~^~~
Language: C++

#include <iostream>
#include <cstdint>
#include <unordered_map>
#include <algorithm>

using i64 = std::int64_t;
using uint = std::uint32_t;

std::unordered_map<i64, int> primeFactor(i64 n) {
    std::unordered_map<i64, int> ret;
    for (i64 i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;

    return ret;
}

i64 exp(i64 x, i64 n) {
    i64 ret = 1;
    while (n != 0) {
        if (n % 2 == 1)
            ret *= x;

        x *= x;
        n /= 2;
    }

    return ret;
}

int main() {
	i64 n;
	std::cin >> n;

    i64 ans = 1;
    for (auto&& p : primeFactor(n - 1))
        ans *= p.second + 1;

    auto map = primeFactor(n);
    std::vector<std::pair<i64, int>> pfacts(map.begin(), map.end());

    for (uint i = 1; i < (1 << map.size()); ++i) {
        int k = 1;
        int pow = 100000;
        for (int j = 0; j < map.size(); ++j) {
            if ((i >> j) & 1 == 1) {
                k *= pfacts[j].first;
                pow = std::min(pow, pfacts[j].second);
            }
        }

        i64 a = exp(k, pow);
        if (a == n)
            continue;

        for (int j = 1; j <= pow; ++j) {
            if (pow % j != 0)
                continue;

            if ((n / a - 1) % exp(k, j) == 0)
                ++ans;
        }
    }

    std::cout << ans << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:10: error: 'vector' is not a member of 'std'
   45 |     std::vector<std::pair<i64, int>> pfacts(map.begin(), map.end());
      |          ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <algorithm>
  +++ |+#include <vector>
    5 | 
a.cc:45:35: error: expected primary-expression before '>' token
   45 |     std::vector<std::pair<i64, int>> pfacts(map.begin(), map.end());
      |                                   ^~
a.cc:45:38: error: 'pfacts' was not declared in this scope
   45 |     std::vector<std::pair<i64, int>> pfacts(map.begin(), map.end());
      |                                      ^~~~~~
Language: C++


// Problem : F - Division or Substraction
// Contest : AtCoder Beginner Contest 161
// URL : https://atcoder.jp/contests/abc161/tasks/abc161_f
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//QWsin
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=nxt[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
using namespace std;
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

typedef long long ll;
const int INF=1<<30;

int main()
{
	ll n;cin>>n;
	ll sz=sqrt(n);
	int sum=0;
	for(ll k=2;k<=sz;++k)
	{
		for(ll base=1;base<=n;base*=k)
		{
			if(n%base!=0) break;
			if(n/base%k==1) ++sum;
		}	
	}
	cout<<sum*2+1<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: 'sqrt' was not declared in this scope
   32 |         ll sz=sqrt(n);
      |               ^~~~
Language: C++

  //shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);
ll k;
ll todo1(ll xx) {
	ll ct = 0;
	for(ll i = 2; i*i <= xx; i++) {
		if(xx%i == 0) {
			ll pp = xx;
			while(pp%i == 0) pp/=i;
			if(pp%i == 1) ct++;
			pp = xx;
			if(xx/i != i) {
				ll ii = xx/i;
				while(pp%ii == 0) pp/=ii;
				if(pp%ii == 1) ct++;
			}
		}
	}
	return ct;
}
ll todo2(ll xx){
	ll ct = 0;
	for(ll i = 2; i*i <= xx; i++) {
		if(xx%i == 0) {
			ct++;
			if(xx/i != i) ct++;
		}
	}
	return ct;
}

int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  cin >> k;
  if(n == 2) {
  	cout << 1 << endl;
  	return 0;
  }
  cout << todo1(k) + todo2(k-1) + 2 << endl;
  return 0;
} //good night.

Compiler output:
a.cc: In function 'int main()':
a.cc:55:6: error: 'n' was not declared in this scope; did you mean 'yn'?
   55 |   if(n == 2) {
      |      ^
      |      yn
Language: C++

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

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  int n;
  cin >> n;
  int ans=0;
  for(int i=2; i<n; i++) {
    if(n%k==0||n%k==1) ans++;
  }
  cout << ans+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'k' was not declared in this scope
   10 |     if(n%k==0||n%k==1) ans++;
      |          ^
Language: C++

#include<stdio.h>

int main(){
	char a[10];
	scanf("%s", &a)
	
	if(a[2]==a[3] && a[4]==a[5]){
		puts("Yes");
	}
	else
	puts("No");
	return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before 'if'
    5 |         scanf("%s", &a)
      |                        ^
      |                        ;
    6 | 
    7 |         if(a[2]==a[3] && a[4]==a[5]){
      |         ~~              
a.cc:10:9: error: 'else' without a previous 'if'
   10 |         else
      |         ^~~~
a.cc:12:9: error: 'return0' was not declared in this scope
   12 |         return0;
      |         ^~~~~~~