結果

問題 No.2751 429-like Number
ユーザー 沙耶花沙耶花
提出日時 2024-05-10 21:37:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,086 ms / 4,000 ms
コード長 903 bytes
コンパイル時間 4,926 ms
コンパイル使用メモリ 262,964 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-10 21:38:03
合計ジャッジ時間 27,656 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
6,812 KB
testcase_01 AC 28 ms
6,944 KB
testcase_02 AC 30 ms
6,940 KB
testcase_03 AC 29 ms
6,940 KB
testcase_04 AC 28 ms
6,944 KB
testcase_05 AC 29 ms
6,940 KB
testcase_06 AC 31 ms
6,944 KB
testcase_07 AC 1,043 ms
6,944 KB
testcase_08 AC 1,085 ms
6,944 KB
testcase_09 AC 1,056 ms
6,940 KB
testcase_10 AC 1,070 ms
6,944 KB
testcase_11 AC 1,053 ms
6,944 KB
testcase_12 AC 1,086 ms
6,940 KB
testcase_13 AC 1,070 ms
6,940 KB
testcase_14 AC 1,006 ms
6,940 KB
testcase_15 AC 1,079 ms
6,940 KB
testcase_16 AC 1,055 ms
6,940 KB
testcase_17 AC 1,075 ms
6,944 KB
testcase_18 AC 1,050 ms
6,944 KB
testcase_19 AC 1,078 ms
6,940 KB
testcase_20 AC 1,058 ms
6,944 KB
testcase_21 AC 1,086 ms
6,940 KB
testcase_22 AC 1,062 ms
6,940 KB
testcase_23 AC 1,083 ms
6,944 KB
testcase_24 AC 1,061 ms
6,944 KB
testcase_25 AC 1,067 ms
6,940 KB
testcase_26 AC 1,071 ms
6,940 KB
testcase_27 AC 1,075 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001

bool is_prime(long long n){
      if(n == 1) return false;
      for(long long i = 2; i * i <= n; i++){
         if(n % i == 0) return false;
      }
      return true;
   
}
int main(){
   vector<long long> ps;
   for(long long i=1;i<=100000;i++){
      if(is_prime(i)){
         ps.push_back(i);
      }
   }
   int t;
   cin>>t;
   rep(i,t){
      long long a;
      cin>>a;
      long long c = 0;
      rep(j,ps.size()){
         while(a%ps[j] ==0){
            c++;
            a /= ps[j];
         }
      }
      if(a!=1)c++;
      if(c==3){
         cout<<"Yes"<<endl;
      }
      else{
         cout<<"No"<<endl;
      }
   }
  
	return 0;
}
0