結果

問題 No.2751 429-like Number
ユーザー Nzt3Nzt3
提出日時 2024-05-10 22:31:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,047 ms / 4,000 ms
コード長 703 bytes
コンパイル時間 2,085 ms
コンパイル使用メモリ 203,972 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-10 22:32:18
合計ジャッジ時間 24,432 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,816 KB
testcase_01 AC 3 ms
6,940 KB
testcase_02 AC 4 ms
6,940 KB
testcase_03 AC 4 ms
6,940 KB
testcase_04 AC 3 ms
6,944 KB
testcase_05 AC 3 ms
6,944 KB
testcase_06 AC 5 ms
6,944 KB
testcase_07 AC 1,015 ms
6,944 KB
testcase_08 AC 1,018 ms
6,940 KB
testcase_09 AC 1,011 ms
6,940 KB
testcase_10 AC 981 ms
6,940 KB
testcase_11 AC 1,010 ms
6,944 KB
testcase_12 AC 1,013 ms
6,944 KB
testcase_13 AC 1,013 ms
6,940 KB
testcase_14 AC 951 ms
6,944 KB
testcase_15 AC 1,047 ms
6,940 KB
testcase_16 AC 1,012 ms
6,944 KB
testcase_17 AC 1,015 ms
6,940 KB
testcase_18 AC 995 ms
6,940 KB
testcase_19 AC 987 ms
6,944 KB
testcase_20 AC 1,015 ms
6,944 KB
testcase_21 AC 1,017 ms
6,940 KB
testcase_22 AC 1,014 ms
6,940 KB
testcase_23 AC 1,019 ms
6,944 KB
testcase_24 AC 987 ms
6,940 KB
testcase_25 AC 990 ms
6,940 KB
testcase_26 AC 1,018 ms
6,940 KB
testcase_27 AC 1,019 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

constexpr int sqrtA=100'000;
constexpr int MAX_X=5'000'000;

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

  vector prime(sqrtA,true);
  for(ll i=2;i<sqrtA;i++){
    if(!prime[i])continue;
    for(ll j=i*i;j<sqrtA;j+=i){
      prime[j]=0;
    }
  }
  vector primes(0,0);
  for(int i=2;i<sqrtA;i++){
    if(prime[i])primes.push_back(i);
  }
  //cerr<<primes.size()<<'\n';
  int Q;
  cin>>Q;
  while(Q--){
    ll A;
    cin>>A;
    int ans=0;
    for(auto i:primes){
      while(A%i==0){
        A/=i;
        ans+=1;
      }
    }
    if(A!=1)ans+=1;
    cout<<(ans==3?"Yes\n":"No\n");
  }
}
0