Language: Java

#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(x) x.begin(),x.end()
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

ll x;
vector<ll>a;
struct Sieve
{
    ll n;
    vector<ll> f, primes;
    Sieve(ll n = 1) : n(n), f(n + 1)
    {
        f[0] = f[1] = -1;
        for (ll i = 2; i <= n; ++i)
        {
            if (f[i])
                continue;
            primes.push_back(i);
            f[i] = i;
            for (ll j = i * i; j <= n; j += i)
            {
                if (!f[j])
                    f[j] = i;
            }
        }
    }
};
bool isprime(ll n){
  int m=sqrt(n);
  for(int i=2;i<=m;i++){
      if(n%i==0)return false;
  }
  return true;
}

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

    cin>>x;
    if(x==1){
        cout<<0<<endl;
       return 0;
    }
    if(isprime(x)){
        cout<<1<<endl;
        return 0;
    }
    int m=sqrt(x);
    ll ans=0;
    for(int i=2;i<=m;i++)
    {
        if(x<i)break;
       if(isprime(i)){
           ll cur=i;
           while(x%cur==0){
               //cout<<cur<<endl;
               ans++;
               x/=cur;
               cur*=i; 
               
           }
       }
    }
    if(x>1)ans++;
    cout<<ans<<endl;
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:2: error: illegal character: '#'
#define rep(i, n) for (ll i = 0; i < (n); ++i)
^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i, n) for (ll i = 0; i < (n); ++i)
                                 ^
Main.java:2: error: class, interface, enum, or record expected
#define rep(i, n) for (ll i = 0; i < (n); ++i)
                                          ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
using ll = long long;
^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: '.class' expected
using ll = long long;
                ^
Main.java:5: error: ';' expected
using P = pair<ll, ll>;
                     ^
Main.java:6: error: illegal character: '#'
#define chmax(x, y) x = max(x, y)
^
Main.java:6: error: class, interface, enum, or record expected
#define chmax(x, y) x = max(x, y)
        ^
Main.java:7: error: illegal character: '#'
#define chmin(x, y) x = min(x, y)
^
Main.java:8: error: illegal character: '#'
#define all(x) x.begin(),x.end()
^
Main.java:10: error: class, interface, enum, or record expected
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
^
Main.java:10: error: class, interface, enum, or record expected
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
                                                              ^
Main.java:14: error: class, interface, enum, or record expected
struct Sieve
^
Main.java:17: error: class, interface, enum, or record expected
    vector<ll> f, primes;
    ^
Main.java:18: error: class, interface, enum, or record expected
    Sieve(ll n = 1) : n(n), f(n + 1)
    ^
Main.java:21: error: class, interface, enum, or record expected
        for (ll i = 2; i <= n; ++i)
        ^
Main.java:21: error: class, interface, enum, or record expected
        for (ll i = 2; i <= n; ++i)
                       ^
Main.java:21: error: class, interface, enum, or record expected
        for (ll i = 2; i <= n; ++i)
                               ^
Main.java:25: error: class, interface, enum, or record expected
            primes.push_back(i);
            ^
Main.java:26: error: class, interface, enum, or record expected
            f[i] = i;
            ^
Main.java:27: error: class, interface, enum, or record expected
            for (ll j = i * i; j <= n; j += i)
            ^
Main.java:27: error: class, interface, enum, or record expected
            for (ll j = i * i; j <= n; j += i)
                               ^
Main.java:27: error: class, interface, enum, or record expected
            for (ll j = i * i; j <= n; j += i)
                                       ^
Main.java:31: error: class, interface, enum, or record expected
            }
            ^
Main.java:45: error: not a statement
    ios::sync_with_stdio(false);
    ^
Main.java:48: error: not a statement
    cin>>x;
       ^
Main.java:50: error: not a statement
        cout<<0<<endl;
               ^
Main.java:54: error: not a statement
        cout<<1<<endl;
               ^
Main.java:74: error: not a statement
    cout<<ans<<endl;
             ^
Main.java:45: error: ';' expected
    ios::sync_with_stdio(false);
                        ^
32 errors