結果

問題 No.2751 429-like Number
ユーザー Y.Y.Y.Y.
提出日時 2024-05-09 09:08:05
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 648 bytes
コンパイル時間 864 ms
コンパイル使用メモリ 97,792 KB
実行使用メモリ 10,524 KB
最終ジャッジ日時 2024-05-10 18:23:55
合計ジャッジ時間 6,717 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 4 ms
6,944 KB
testcase_03 AC 14 ms
6,944 KB
testcase_04 AC 33 ms
6,940 KB
testcase_05 AC 58 ms
6,944 KB
testcase_06 AC 140 ms
6,944 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;
typedef long long ll;
typedef string str;

int main() {
  ll Q;
  cin >> Q;

  vector<ll> A(Q);
  for(ll i=0; i<Q; i++){
    cin >> A[i];
  }

  ll counter = 0;
  ll num;
  
  for(ll j=0; j<Q; j++){
    counter = 0;
    num = A[j];
    
    for(ll i=2; i <= pow(A[j], 0.5)+1; i++){
      while(num % i == 0){
        num /= i;
        counter++;
        if(counter > 3)
          goto label_break;
      }
    }
    if(num != 1)
      counter++;

    label_break:
    if(counter == 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  
  return 0;
}
0