結果
| 問題 | 
                            No.2751 429-like Number
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-05-09 08:53:41 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 648 bytes | 
| コンパイル時間 | 1,110 ms | 
| コンパイル使用メモリ | 97,792 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-12-20 04:03:39 | 
| 合計ジャッジ時間 | 18,289 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 4 | 
| other | AC * 4 WA * 18 | 
ソースコード
#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[i], 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;
}