結果
| 問題 |
No.2379 Burnside's Theorem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-14 21:28:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 3,588 bytes |
| コンパイル時間 | 2,500 ms |
| コンパイル使用メモリ | 191,456 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-16 06:16:40 |
| 合計ジャッジ時間 | 2,896 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 20 |
ソースコード
#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 << "]";}