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

//52行目から編集
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <cassert>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvl;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

template<class T> bool chmin(T& a,T b){if(a > b){a = b;return true;}else return false;}
template<class T> bool chmax(T& a,T b){if(a < b){a = b;return true;}else return false;}
///////////////////////////////////////////////////////////

vector<ll> divisors(ll n){
    vector<ll> res;
    ll i;
    for(i = 1;i * i < n;i++){
       if(n % i == 0){
           res.push_back(i);
           res.push_back(n / i);
       }
    }
    if(i * i == n){
        res.push_back(i);
    }
    sort(res.begin(),res.end());
    return res;
}
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //cout << fixed << setprecision(20);

    ll n;cin >> n;
    vector<ll> d_n = divisors(n-1);
    vector<ll> d_n1 = divisors(n);
    set<ll> ans;
    for(auto i : d_n)if(i != 1)ans.insert(i);
    for(auto i : d_n1){
        if(i == 1){
            //ans.insert(i);
            continue;
        }else{
            ll m = n;
            while(m > 0 && (m % i == 0)){
                m = (m / i);
            }
            if(m % k == 1)ans.insert(i);
        }
    }
    cout << ans.size() << '\n';
    return 0;
}
/*
 *!!CHECK!! 
 * 制約をよく読め：まず最も愚直な解法を考えろ
 * intの掛け算をしてる場合：overflowは大丈夫？
 * 制約の下限・上限は大丈夫？
 * 木構造は一直線にした時TLEしない？
 * */


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

#include<bits/stdc++.h>
#include"Templates/libraries.h"
using namespace std;
int main(){
  lli n, n2,N;
  cin >> n;
  N=n2=n-1;
  map<lli,lli> m, m2;
  for(int i=2;i<=sqrt(n)+1;i++){
    while(n%i==0){
      n=n/i;
      m[i]++;
    }
  }
  if(n>1)m[n]++;
  if(n!=N+1)m2[N+1]++;
  for(int i=2;i<=sqrt(n2)+1;i++){
    while(n2%i==0){
      n2=n2/i;
      m2[i]++;
    }
  }
  if(n2>1)m2[n2]++;
  lli ans=0,ans2=1;
  for(auto e: m){
    if(((N+1)/(lli)pow(e.first,e.second))%e.first==1)ans++;
  }
  for(auto e: m2){
    ans2*=e.second+1;
  }
  cout << ans + ans2 - 2;
}

Compiler output:
a.cc:2:9: fatal error: Templates/libraries.h: No such file or directory
    2 | #include"Templates/libraries.h"
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    N = II()
    def divisors(x):
        r1 = deque()
        r2 = deque()
        for i in range(1,ceil(x**0.5)):
            if x % i == 0:
                r1.append(i)
                r2.appendleft(x//i)
        if int(x**0.5) == x**0.5:
            r1.append(int(x**0.5))
        return list(r1)+list(r2)
    #N-1の約数
    ans = len(divisors(N-1))-1
    # print(ans)
    # print(divisors(N))
    for d in divisors(N)[1:]:
        tmpN = N
        while tmpN % d == 0:
            tmpN //= d
        if tmpN % d == 1:
            ans += 1

            
            
    print(ans)


    

if __name__ == '__main__':
    main()

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #coding
    1 | #coding:utf-8
      |  ^~~~~~
a.cc:8:49: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
    8 | dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
      |                                                 ^~~~~~~~~~~~~~
a.cc:14:27: warning: multi-character character constant [-Wmultichar]
   14 |     YN = lambda c : print('Yes') if c else print('No')
      |                           ^~~~~
a.cc:14:50: warning: multi-character character constant [-Wmultichar]
   14 |     YN = lambda c : print('Yes') if c else print('No')
      |                                                  ^~~~
a.cc:28:6: error: invalid preprocessing directive #N
   28 |     #N-1の約数
      |      ^
a.cc:30:7: error: invalid preprocessing directive #print
   30 |     # print(ans)
      |       ^~~~~
a.cc:31:7: error: invalid preprocessing directive #print
   31 |     # print(divisors(N))
      |       ^~~~~
a.cc:46:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   46 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: 'import' does not name a type
    2 | import sys,os
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

int main() {
	long long n; cin >> n;
    int cnt = divisor(n - 1).size() - 1;
    auto tmp = divisor(n);
    for (auto a : tmp) {
        if (a == 1) continue;
        long long t = n;
        while (t % a == 0) t /= a;
        if (t % a == 1) ++cnt;
    }
    cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'std::vector<long long int> divisor(long long int)':
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(res.begin(), res.end());
      |     ^~~~
      |     short
Language: C++

#include<iostream>


using namespace std;


int main() {
	long long n;
	cin >> n;
	double level = sqrt(n);
	long long count = 2;
	long long work;
	long long j;
	for (long long i = 2;i <= level;i++) {
		if (n % i == 0) {
			work = n;
			while (work >= i) {
				if (work % i == 0)work /= i;
				else work %= i;
			}
			if (work == 1)count++;
			if ((double)i != level) {
				work = n;
				j = n / i;
				while (work >= j) {
					if (work % j == 0)work /= j;
					else work %= j;
				}
				if (work == 1)count++;
			}
		}
		if ((n - 1) % i == 0) {
			if ((double)i == sqrt(n - 1))count++;
			else count += 2;
		}
	}
	cout << count << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'sqrt' was not declared in this scope
   10 |         double level = sqrt(n);
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{ll to,cost;};
const int inf = 1<<27;
const ll INF = 1LL<<60;
const int COMBMAX = 1001001;
const ll MOD = 1000000007;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for(const auto& e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (ll)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (ll)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
ll mpow(ll a, ll n, ll mod = MOD){ll res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> ll bcount(T1 v, T2 a){return upper_index(v, a) - lower_index(v, a);} 
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> void sortTwoVecter(vector<T1> &f, vector<T2> &s, bool isReverse = false){
    vector<pair<T1, T2>> p;
    rep(i, f.size()) p.emplace_back(make_pair(f[i], s[i]));
    if (!isReverse) sort(p.begin(), p.end());
    else sort(p.rbegin(), p.rend());
    rep(i, f.size()) tie(f[i], s[i]) = p[i];
    return;
}

ll f(ll n, ll m){
    while(n % m == 0) n /= m;
    return n;
}

int main(){
    ll N; cin >> N;
    if (N == 2){
         cout << 1 << endl;
         return; 
    }
    ll ans = 2;
    for(ll i = 2; i <= pow(N, 0.5); i++){
        if ((N - 1) % i == 0){
            ans++;
            if (i * i == N - 1) continue;
            ans++;
        }else if (N % i == 0){
            if (f(N, i) % i == 1) ans++;
            if (i * i == N) continue;
            if (f(N, (N / i)) % (N / i) == 1) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:10: error: return-statement with no value, in function returning 'int' [-fpermissive]
   43 |          return;
      |          ^~~~~~
Language: C++

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		sc.close();

		HashSet<Long> answers = new HashSet<Long>();
		List<Long> list1 = getDivisors(n - 1);
		for (long k : list1) {
			if (k >= 2) {
				answers.add(k);
			}
		}

		List<Long> list2 = getDivisors(n);
		for (long k : list2) {
			if (k >= 2 && check(n, k)) {
				answers.add(k);
			}
		}
		System.out.print(answers.size());
	}

	public static boolean check(long n, long k) {
		List<Long> list1 = getDivisors(n - 1);
		if (list1.contains(k)) {
			return true;
		}

		long divisor = n / k;
		if (divisor == 1) {
			return true;
		} else if (divisor >= k) {
			return check(divisor, k);
		}

		return false;
	}

	public static List<Long> getDivisors(long number) {
		List<Long> list1 = new ArrayList<Long>();
		for (long i = 1; i < (long) Math.sqrt(number) + 1; i++) {
			if (number % i == 0) {
				list1.add(i);
			}
		}

		List<Long> list2 = new ArrayList<Long>();
		for (long i : list1) {
			long divisor = number / i;
			if (divisor != i) {
				list2.add(divisor);
			}
		}

		Collections.reverse(list2);
		list1.addAll(list2);
		return list1;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.ArrayList;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Collections;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.HashSet;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.List;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.util.Scanner;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: expected unqualified-id before 'public'
    7 | public class Main {
      | ^~~~~~
Language: C++

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n;
	cin >> n;
    int c = 0;
  int ans=0;
  	int k;
  	for ( k = 1; k <= sqrt(n-1); k++ ) { 
    	if (n-1 % k == 0)c+=2;
      	if(sqrt(n-1)*sqrt(n-1)==n-1)c--;
  	}
    ans+=c-1;
  	for( k = 1; k <= sqrt(n); k++ ) {
    	if (n % k == 0){
          int nn=n;
          while(nn%k!=0){
            nn/k;
          }
          if(nn%k=1)ans++;
        }
  	}
      cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: lvalue required as left operand of assignment
   32 |           if(nn%k=1)ans++;
      |              ~~^~
Language: C++

#include <iostream>
#include <vector>

typedef long long ll;

using namespace std;

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

int main(){
    ll n;
    cin >> n;
    vector<ll> div1 = div(n);
    vector<ll> div2 = div(n-1);
    int ans = div2.size()-1;
    for (auto d:div1){
        if(d==1)
            continue;
        ll tmp = n;
        while(tmp%d==0)
            tmp/=d;
        if((tmp-1)%d==0)
            ans ++;
   }
   cout <<ans<<endl;
   return 0;

}


Compiler output:
a.cc: In function 'std::vector<long long int> div(ll)':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(begin(ret),end(ret));
      |     ^~~~
      |     short
Language: C++

#include <stdio.h>
#define LL long long
LL n,cnt;
int judge(LL k,LL m){
	while(m>=k){
		if(m%k==0)m/=k;
		else m%=k;
	}
	if(m==1)return 1;
	else return 0;
}
int main(){
	LL i;
	scanf("%lld",&n);
	if(n==2){printf("1\n");return 0);}//注意n=2需特判
	for(i=2;i*i<=n-1;i++)//找n-1的约数
		if((n-1)%i==0){
			cnt++;
			if(i!=(n-1)/i)cnt++;
		}
	cnt++;//加上n-1本身
	for(i=2;i*i<=n;i++)
		if(n%i==0){
			if(judge(i,n))cnt++;
			if(i!=n/i&&judge(n/i,n))cnt++;
		}
	cnt++;//加上n本身
	printf("%lld\n",cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before ')' token
   15 |         if(n==2){printf("1\n");return 0);}//注意n=2需特判
      |                                        ^
      |                                        ;
a.cc:15:40: error: expected primary-expression before ')' token
Language: C++

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

long long int num_yakusu(long long int N){
    long long int num=0;
    for(long long int i=1;i*i<=N;i++){
        if(i*i==N)num++;
        else if(N%i==0)num+=2;
    }
    return num;
}

long long int num_yakusu_neo(long long int N){
    long long int num=0;
    for(long long int i=2;i*i<=N;i++){
        if(i*i==N)num++;
        else if(N%i==0){
            long long int j = N/i;
            long long int k=N;
            while(k<i){
                if(k%i==0)k /= i;
                else{k %= i;}
            }
            if(k==1)num++;
            k=N;
            while(k<j){
                if(k%j==0)k /= j;
                else{k %= j;}
            }
            if(k==1)num++;
    }
    return num;
}

int main(){
	long long int n;
	cin >> n;
	cout << num_yakusu_neo(n)+num_yakusu(n-1)-1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int num_yakusu_neo(long long int)':
a.cc:35:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   35 | int main(){
      |         ^~
a.cc:35:9: note: remove parentheses to default-initialize a variable
   35 | int main(){
      |         ^~
      |         --
a.cc:35:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:35:11: error: a function-definition is not allowed here before '{' token
   35 | int main(){
      |           ^
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:13:46: note: to match this '{'
   13 | long long int num_yakusu_neo(long long int N){
      |                                              ^
a.cc:40:2: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      |  ^
Language: C++

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

int main(){

	ll n;
	cin>>n;
	ll cnt=2;
	set<ll> st;
    if(n==2){
    	cout<<1<<endl;
    	return 0;
    }
    ll cnt=0;
	FOR(i,2,sqrt(n)){
		ll tmp=n;
		while(tmp%i==0){
			tmp=tmp/i;

		}
		if(tmp%i==1) {cnt++; }
	}
	st.insert(n);
	st.insert(n-1);

	FOR(i,2,sqrt(n-1)){
		ll tmp=n-1;
		
		if(tmp%i==0) {cnt+=2 }
		

	}
	cout<<cnt<<endl;

	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: redeclaration of 'int64_t cnt'
   33 |     ll cnt=0;
      |        ^~~
a.cc:27:12: note: 'int64_t cnt' previously declared here
   27 |         ll cnt=2;
      |            ^~~
a.cc:48:37: error: expected ';' before '}' token
   48 |                 if(tmp%i==0) {cnt+=2 }
      |                                     ^~
      |                                     ;
Language: C++

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

int main(){

	ll n;
	cin>>n;
	ll cnt=2;
	set<ll> st;
    if(i==2){
    	cout<<1<<endl;
    	return 0;
    }
	FOR(i,2,sqrt(n)){
		ll tmp=n;
		while(tmp%i==0){
			tmp=tmp/i;

		}
		if(tmp%i==1) {st.insert(i); }
	}
	st.insert(n);
	st.insert(n-1);

	FOR(i,2,sqrt(n-1)){
		ll tmp=n-1;
		
		if(tmp%i==0) {st.insert(i); st.insert((n-1)/i); }
		

	}
	cout<<sz(st)<<endl;

	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: 'i' was not declared in this scope
   29 |     if(i==2){
      |        ^
Language: C++

/******************************************
* NICK : nikhilsinghh59 *
******************************************/
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"

#define PB push_back
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
const int M = 1e9+7;
int main()
{   
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    ll n;
    cin >> n;
    
    if(n==2) {
        cout << 1;
        continue;
    }

    // k = (n-1)/m

   // int m=1;

    ll ans=1;

    for(ll i=2 ; i<=sqrt(n-1) ; i++) {
        if((n-1)%i==0) {
            ans++;
            if((n-1)/i != i) ans++;
        }
    }

    for(int i=2 ; i<=sqrt(n) ; i++) {
        if(n%i==0) {
            ll k = n;
            while(k%i==0) {
                k/=i;
            }
            if(k%i == 1) {
                ans++;
            }

            if(n/i != i) {
                k = n;
                while(k%(n/i) == 0) {
                    k/=(n/i);
                }
                if(k%(n/i) == 1) {
                    ans++;
                }
            }
        }
    }

    cout << ans+1;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: continue statement not within a loop
   27 |         continue;
      |         ^~~~~~~~
Language: C++

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

bool check(ll n, ll k){
    if (n == 1) return true;
    if (n < k) return false;
    if (n % k == 0) {
        return check(n/k,k);
    } else {
        return check(n%k,k);
    }
}

vector<ll> get_div(ll n){
    vector<ll> res;
    for (ll d = 2; d*d <= n; d++) {
        if(n % d == 0){
            res.push_back(d);
            if (d < n/d) {
                res.push_back(n/d);
            }
        }
    }
    return res;
}

int main(void){
    ll n;
    cin >> n;
    if (n == 2) {
        cout << 1 << endl;
        return 0;
    }
    vector<ll> cand = {n, n-1};
    cand.insert(cand.end(), all(get_div(n)));
    cand.insert(cand.end(), all(get_div(n-1)));
    set<ll> res;
    for (ll d : cand){
        if (check(n,d)) res.insert(d);
    }
    cout << res.size() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:29: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   36 |     cand.insert(cand.end(), all(get_div(n)));
      |                             ^~~
      |                             std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
const double eps = 1e-8;
const int NINF = 0xc0c0c0c0;
const int INF  = 0x3f3f3f3f;
const ll  mod  = 1e9 + 7;
const ll  maxn = 1e6 + 5;

int main() {
	ll n;
	scanf("%lld", &n);
	int ans = 0;
	for (int i = 1; i * 1ll * i <= n - 1; ++i) {
		if ((n - 1) % i == 0) {
			if (i > 1) ans++;
			if ((n - 1) / i != i) ans++;
		}
	}
	auto check = [&](ll v) {
		ll x = n;
		while (x % v == 0) x /= v;
		if (x % v == 1) {
			debug(imie(v), "works");
			ans++;
		}
	};
	for (int i = 1; i * 1ll * i <= n; ++i) {
		if (n % i == 0) {
			if (i > 1) check(i);
			if (i != n / i) check(n / i);
		}
	}
	printf("%d\n", ans);
}

Compiler output:
a.cc: In lambda function:
a.cc:25:31: error: 'imie' was not declared in this scope
   25 |                         debug(imie(v), "works");
      |                               ^~~~
a.cc:25:25: error: 'debug' was not declared in this scope
   25 |                         debug(imie(v), "works");
      |                         ^~~~~
Language: C++

#include <iostream>//数据输入输出流
#include <cstring>//字符串操作函数
#include <cstdio>//C的输入输出
#include <cstdlib>//定义杂项函数及内存分配函数
#include <cmath>//C中的数学函数
#include <string>//c++中的string类 他不能用strcpy等c函数去操作
#include <vector>//STL vetor
#include <list>//STL list
#include <map>// STL map
#include <queue>// STL queue
#include <stack>//sTL stack
#include <bitset>//bitset可按位定义串
//比如：bitset <1000> all;定义一个1000位的串
#include <algorithm>//STL各种算法 比如 swap sort merge max min 比较
#include <numeric>//常用数字操作 一般和algorithm搭配使用
#include <functional>//STL定义运算函数（代替运算符）
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define LOCAL
#define zeros(a,n) memset(a,0,(n)*sizeof(a[0]))
const int modn = 1e9+7;
int mod(int x) { return x<0?x+modn:x<modn?x:x-modn; }
//inv [ i ] = (modn - modn/i)*inv[ modn%i ] %modn;
int main()
{
    ios::sync_with_stdio(false); cin.tie(0);
    LL n;   
    cin >> n;
    if(n == 2) {

        cout<<1<<endl;
        return;
    }
    LL ans = 2;
    for(LL i = 2; i * i <= n; ++i){
        if(n % i == 0){
            LL  x = i, y = n / i;
            while(y % x == 0) y /= x;
            if(y % x == 1) ans++;
        }
    }
    n--;
    for(LL i = 2; i * i <= n; ++i){
        if(n%i==0){
            ans+=1;
            if(i * i != n) ans += 1;
        }
    }
    cout << ans<< endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   33 |         return;
      |         ^~~~~~
Language: C++

//
// Created by Hideaki Imamura on 2020-04-04.
//
# include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair <ll, ll> l_l;
typedef pair<int, int> i_i;

template<class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

# define EPS (1e-7)
# define INF (1e9)
# define PI (acos(-1))
//const ll mod = 1000000007;

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

ll N;

int main() {
    cin >> N;

    vector<ll> div_n = divisor(N);
    vector<ll> div_n_1 = divisor(N - 1);

    ll ans = div_n_1.size() - 1;
    for (auto x : div_n) {
        if (x == 1) continue;
        ll tmp = N;
        while (tmp % x == 0 && tmp > 0) tmp /= x;
        if (tmp % x == 1) ans++;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:31: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   51 |     vector<ll> div_n = divisor(N);
      |                        ~~~~~~~^~~
a.cc:52:33: error: conversion from 'vector<long int>' to non-scalar type 'vector<long long int>' requested
   52 |     vector<ll> div_n_1 = divisor(N - 1);
      |                          ~~~~~~~^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int fun(ll n , ll i)
{
	while(n < i)
	{
	
		if(n%i == 0)
		n /= i;
		else
		n -= i;
		if(n == 1)
		return 1;
	}
	return 0;
}
int main()
{
	ll n, k;
	cin >> n ;
	b = 1;
	for(ll i = 2; i < n; i ++)
	if(fun(n,i))
	b ++;
	cout << b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'b' was not declared in this scope
   22 |         b = 1;
      |         ^
Language: C++

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

int main() {
  int N, a = 0;
  cin >> N;
  for (int i = 3; i < N/2; i++) {
    int b = N;
    while (N%i = 0) b /= i;
    if (b%i = 1) a++;
  }
  
  cout << a+3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: lvalue required as left operand of assignment
    9 |     while (N%i = 0) b /= i;
      |            ~^~
a.cc:10:10: error: lvalue required as left operand of assignment
   10 |     if (b%i = 1) a++;
      |         ~^~
Language: C++

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


bool is(ll n, ll k){
    while(n >= k){
        if(n % k == 0){
            n =  n / k;
        }else{
            n %= k;
        }
    }
    return n == 1;
}

void solve(long long N){
    ll ans = 0;
    for(int i = 2;i <= ceil(sqrt(N)); i++){
        if(N % i != 0)continue;
        if(is(N, i)){
            ans++;
        }
        
        if(is(N, N / i)){
            ans++;
        }
        if(i * i == N)ans--;
    }
    ans += 2;

    for(ll i = 2;i <= ceil(sqrt(N-1));i++){
        if((N-1) % i == 0){
            ans += 2;
            if(i * i == N-1)ans--;
        }
    }
    
    cout<<v.size()<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    solve(N);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int)':
a.cc:39:11: error: 'v' was not declared in this scope
   39 |     cout<<v.size()<<endl;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long a,b=0;
  cin >> a;
  for(int i = 0;i<a;i++){
  	if(a % i == 0){
    	b++;
    }
  }
  cout << b
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before '}' token
   11 |   cout << b
      |            ^
      |            ;
   12 | }
      | ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main ()
{
    long long n;
    cin >> n;
    long long count = 0;
    for (long long i=2; i<=n; i++) {
        if (n%i==0) {
            long long temp = n;
            while (temp%i==0) temp = temp/i;
            if (temp>i) temp = temp%i;
            if (temp==1) count++;
        }
        else if ((n-1)%i==0) count++;
    }
    cout << count << endl;
    return 0;
}v

Compiler output:
a.cc:21:2: error: 'v' does not name a type
   21 | }v
      |  ^
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for (int i = 1; i <= (max((int)sqrt(n), (int)100000); i++) {
		if (i == 1)continue;
			if ((n - 1) % i == 0) {
				ans.insert(i);
					ans.insert((n - 1) / i);
			}
			else {
				m = n;
					while (m%i == 0)m /= i;
					if (m%i == 1)ans.insert(i);
			}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:61: error: expected ')' before ';' token
   12 |         for (int i = 1; i <= (max((int)sqrt(n), (int)100000); i++) {
      |                              ~                              ^
      |                                                             )
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <fstream>
#include <sstream>
using namespace std;

typedef long long ll;

ll operation(ll x, ll K) {
    while (x > K) {
        if (x % K == 0) x = x / K;
        else x = x % K;
    }
    return x;
} 

bool isGood(ll x, ll K) {
    while (x % K == 0) {
        x /= K;
    }

    return (x % K == 1)
}

int main(){
    ll N;
    cin >> N;    

    vector<ll> toTest;

    for (ll i = 2; i * i <= N; i++) {
        if (N % i == 0) {
            toTest.push_back(i);
            if (i != N / i) toTest.push_back(N / i);
        }
    }

    ll n = N - 1;

    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) {
            toTest.push_back(i);
            if (i != n / i) toTest.push_back(n / i);
        }
    }

    // toTest.push_back(N);
    // toTest.push_back(n);

    ll ans = 2;
    for (auto it: toTest) {
        if (isGood(N, it)) ans++;
    }
    cout << ans;
    
    return 0;
}

Compiler output:
a.cc: In function 'bool isGood(ll, ll)':
a.cc:25:24: error: expected ';' before '}' token
   25 |     return (x % K == 1)
      |                        ^
      |                        ;
   26 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for(int i = 1; i <= ((int)max(sqrt(n), (int)100000);i++) {
		if (i == 1)continue;
		if ((n - 1) % i == 0) {
			ans.insert(i);
			ans.insert((n - 1) / i);
		}
		else {
			m = n;
			while (m%i == 0)m /= i;
			if (m%i == 1)ans.insert(i);
		}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:38: error: no matching function for call to 'max(__gnu_cxx::__enable_if<true, double>::__type, long long int)'
   12 |         for(int i = 1; i <= ((int)max(sqrt(n), (int)100000);i++) {
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:12:38: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'long long int')
   12 |         for(int i = 1; i <= ((int)max(sqrt(n), (int)100000);i++) {
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~
/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:
/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:12:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   12 |         for(int i = 1; i <= ((int)max(sqrt(n), (int)100000);i++) {
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:12:60: error: expected ')' before ';' token
   12 |         for(int i = 1; i <= ((int)max(sqrt(n), (int)100000);i++) {
      |                             ~                              ^
      |                                                            )
Language: C++

#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for1(i, max(sqrt(n), (int)100000)) {
		if (i == 1)continue;
		if ((n - 1) % i == 0) {
			ans.insert(i);
			ans.insert((n - 1) / i);
		}
		else {
			m = n;
			while (m%i == 0)m /= i;
			if (m%i == 1)ans.insert(i);
		}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'max(__gnu_cxx::__enable_if<true, double>::__type, long long int)'
   13 |         for1(i, max(sqrt(n), (int)100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:13:20: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'long long int')
   13 |         for1(i, max(sqrt(n), (int)100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
/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:
/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:13:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   13 |         for1(i, max(sqrt(n), (int)100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
Language: C++

#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for1(i, max(sqrt(n), (INT)100000)) {
		if (i == 1)continue;
		if ((n - 1) % i == 0) {
			ans.insert(i);
			ans.insert((n - 1) / i);
		}
		else {
			m = n;
			while (m%i == 0)m /= i;
			if (m%i == 1)ans.insert(i);
		}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: 'INT' was not declared in this scope
   13 |         for1(i, max(sqrt(n), (INT)100000)) {
      |                               ^~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
Language: C++

#include<bits/stdc++.h>
#define int long long
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int input() {
	int r;
	scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for1(i, max(sqrt(n), 100000)) {
		if (i == 1)continue;
		if ((n - 1) % i == 0) {
			ans.insert(i);
			ans.insert((n - 1) / i);
		}
		else {
			m = n;
			while (m%i == 0)m /= i;
			if (m%i == 1)ans.insert(i);
		}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'max(__gnu_cxx::__enable_if<true, double>::__type, int)'
   13 |         for1(i, max(sqrt(n), 100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:13:20: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   13 |         for1(i, max(sqrt(n), 100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
/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:
/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:13:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   13 |         for1(i, max(sqrt(n), 100000)) {
      |                 ~~~^~~~~~~~~~~~~~~~~
a.cc:3:41: note: in definition of macro 'for1'
    3 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
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);
	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){
		debug(n);
		ll xx=tmp/n;
		if(xx!=1 && xx%n==1) ans++;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:17: error: 'debug' was not declared in this scope
   70 |                 debug(n);
      |                 ^~~~~
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);
	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){
		debug(n);
		ll xx=tmp/n;
		if(xx!=1 && xx%n==1) ans++;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:32:10: fatal error: debug.h: No such file or directory
   32 | #include "debug.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long N;cin>>N;
  
  //N=K^i mod K^(i+1)で確かめる
  long ans=0;
  for(long k=2;k*k<=N;k++){
    long p=1;
    //cout<<k<<" : ";
    while(N>=p){
      //cout<<(N-p)%(p*k)<<" ";
      if((N-p)%(p*k)==0)ans++;
      p*=k;
    }
    //cout<<endl;
  }


  ans=0;long n1=N-1;long c=0;
  for(long i=2;i*i<=N;i++){
    if(n1%i==0 && (n1/i)*(n1/i)>N)c++;
  }




  cout<<ans+c<<endl;
}
  //long ans=0;
  ans=0;
  for(long k=2;k<=N;k++){
    long n=N;
    while(n%k==0)n/=k;
    if(n%k==1){
      ans++;cout<<k<<" ";
    }
  }
  cout<<endl;
  cout<<ans<<endl;
  /*
  long trueans=0;
  for(long k=2;k<=N;k++){
    long n=N;
    //cout<<"k="<<k<<" :"<<n<<" ";
    while(n>=k){
      if(n%k==0)n/=k;
      else n-=k;
      //cout<<n<<" ";
    }
    //cout<<" "<<n<<" "<<N%k<<endl;
    trueans+=(n==1);
  }
  cout<<trueans;
*/
  
}

/*

k進数で表して0ではない一番下の桁が1ならok

ただし, 

*/

Compiler output:
a.cc:31:3: error: 'ans' does not name a type
   31 |   ans=0;
      |   ^~~
a.cc:32:3: error: expected unqualified-id before 'for'
   32 |   for(long k=2;k<=N;k++){
      |   ^~~
a.cc:32:16: error: 'k' does not name a type
   32 |   for(long k=2;k<=N;k++){
      |                ^
a.cc:32:21: error: 'k' does not name a type
   32 |   for(long k=2;k<=N;k++){
      |                     ^
a.cc:39:3: error: 'cout' does not name a type
   39 |   cout<<endl;
      |   ^~~~
a.cc:40:3: error: 'cout' does not name a type
   40 |   cout<<ans<<endl;
      |   ^~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
//#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
int input() {
	int r;
	cin >> r;
	//scanf("%lld", &r);
	return r;
}
set<int>ans;
signed main() {
	int n = input(), m;
	for1(i, sqrt(n)) {
		if (i == 1)continue;
		if ((n - 1) % i == 0) {
			ans.insert(i);
			ans.insert((n - 1) / i);
		}
		else {
			m = n;
			while (m%i == 0)m /= i;
			if (m%i == 1)ans.insert(i);
		}
	}
	ans.insert(n - 1);
	ans.insert(n);
	printf("%d\n", ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'sqrt' was not declared in this scope
   23 |         for1(i, sqrt(n)) {
      |                 ^~~~
a.cc:10:41: note: in definition of macro 'for1'
   10 | #define for1(i, n) for(int i = 1; i <= (n);i++)
      |                                         ^
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(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:19: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   21 |     if(pow(n,1/i) % 1 == 0)res++;
      |        ~~~~~~~~~~ ^ ~
      |           |         |
      |           |         int
      |           __gnu_cxx::__promote<double>::__type {aka double}