結果

問題 No.2379 Burnside's Theorem
ユーザー Manipradeep BManipradeep B
提出日時 2023-07-14 21:26:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,495 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 224,388 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 11:23:23
合計ジャッジ時間 3,407 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define display(a) {for(int i=0;i<a.size();i++) cout<<a[i]<<" "; cout<<endl;}
using ll = long long;
#define all(v)                      v.begin(),v.end()
#define getunique(v)                {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
#define pb                          push_back
#define ff                          first
#define ss                          second
#define endl                        "\n"
#define fast_io                     ios_base::sync_with_stdio(false);cin.tie(NULL)
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x <<" "; _print(x); cerr << endl;
#else
#define debug(x)
#endif
 
void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
 
template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template<class T> void _print(queue<T> q);
template<class T> void _print(stack<T> stk);
template<class T> void _print(priority_queue<T> pq);
template<class T> void _print(priority_queue<T, vector<T>, greater<T>> pq);
template<class T> void _print(deque<T> dq);

const int N=1e6+10;

vector<bool> isprime(N,1);

vector<int> primes;

void seive(){
    isprime[0]=isprime[1]=0;
    for(int i=2;i<N;i++){
        if(!isprime[i]) continue;
        for(int j=2*i;j<N;j+=i){
            isprime[j]=0;
        }
    }
    for(int i=0;i<N;i++){
        if(isprime[i]) primes.pb(i);
    }
}

void solve(){
    ll n;cin>>n;
    int c=0;
    for(auto i : primes){
        if(n%i) continue;
        c++;
        while(n%i==0){
            n/=i;
        }
    }
    if(n>1) c++;
    if(c<=2){
        cout<<"YES\n";
    }else cout<<"NO\n";
}

int main(){
    seive();
    fast_io;int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
}

 
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
template<class T> void _print(queue<T> q){cerr << "[";while (!q.empty()){T i = q.front();q.pop();cerr << i;cerr << " ";}cerr << "]";}
template<class T> void _print(stack<T> st){cerr << "[";while (!st.empty()){_print(st.top());st.pop();cerr << " ";}cerr << "]";}
template<class T> void _print(priority_queue<T> pq){cerr << "[";while (!pq.empty()){_print(pq.top());pq.pop();cerr << " ";}cerr << "]";}
template<class T> void _print(priority_queue<T, vector<T>, greater<T>> pq){cerr << "[";while (!pq.empty()){_print(pq.top());pq.pop();cerr << " ";}cerr << "]";}
template<class T> void _print(deque<T> dq){cerr << "[";for (T i : dq){_print(i);cerr << " ";}cerr << "]";}
0