結果

問題 No.2379 Burnside's Theorem
ユーザー Ibrahim HammashIbrahim Hammash
提出日時 2023-07-14 21:30:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 1,192 bytes
コンパイル時間 2,205 ms
コンパイル使用メモリ 223,440 KB
実行使用メモリ 36,868 KB
最終ジャッジ日時 2023-10-14 11:29:34
合計ジャッジ時間 4,135 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
35,220 KB
testcase_01 AC 38 ms
35,280 KB
testcase_02 AC 38 ms
35,808 KB
testcase_03 AC 38 ms
35,124 KB
testcase_04 AC 39 ms
35,956 KB
testcase_05 AC 40 ms
35,128 KB
testcase_06 AC 40 ms
35,732 KB
testcase_07 AC 41 ms
36,448 KB
testcase_08 AC 40 ms
36,424 KB
testcase_09 AC 40 ms
35,616 KB
testcase_10 AC 40 ms
35,320 KB
testcase_11 AC 39 ms
35,336 KB
testcase_12 AC 41 ms
36,024 KB
testcase_13 AC 40 ms
35,764 KB
testcase_14 AC 41 ms
36,868 KB
testcase_15 AC 40 ms
36,428 KB
testcase_16 AC 41 ms
35,332 KB
testcase_17 AC 39 ms
35,328 KB
testcase_18 AC 40 ms
35,912 KB
testcase_19 AC 41 ms
35,988 KB
testcase_20 AC 39 ms
35,600 KB
testcase_21 AC 39 ms
35,612 KB
testcase_22 AC 6 ms
18,520 KB
testcase_23 AC 39 ms
36,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define go(); ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define debug(x) cout<<#x<<" "<<x<<endl;
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set=tree <T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
typedef long long ll;
typedef long double ld;
const ll mod=1e9+7;
const ll mxn=2e5+3;
const ll inf=1e18;

vector<ll>p,c(2000000+10,0);
void seive()
{
  for(ll i=2;i<=2000000;i++)
  {
    if(c[i])
    continue;
    p.push_back(i);
    for(ll j=i*i;j<=200000;j+=i)
    {
      c[j]=1;
    }
  }
}
void solve()
{
  ll n;
  cin>>n;
  ll c=0;
  if(n==1)
  {
    cout<<"Yes\n";
    return;
  }
  seive();
  for(int i=0;i<p.size();i++)
  {
    if(n%p[i]==0)
    {
      c++;
      // debug(p[i]);
      while(n%p[i]==0)
      {
        n/=p[i];
      }
    }
  }
  if(n>1)
  c++;

  if(c==2||c==1)
  {
    cout<<"Yes\n";
  }
  else cout<<"No\n";
 
  
}


int main()
{
   
    go();

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