結果

問題 No.2751 429-like Number
ユーザー otoshigo
提出日時 2024-05-10 23:17:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 616 bytes
コンパイル時間 1,889 ms
コンパイル使用メモリ 192,868 KB
最終ジャッジ日時 2025-02-21 13:16:34
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 4 TLE * 1 -- * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;}
template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int Q;
	cin>>Q;
	while(Q--){
		ll A;
		cin>>A;
		int cnt=0;
		for(ll x=2;x*x<=A;x++){
			if(A%x==0){
				while(A>0&&A%x==0){
					cnt++;
					A/=x;
				}
			}
		}
		if(A>1)cnt++;
		if(cnt==3)cout<<"Yes\n";
		else cout<<"No\n";
	}
}
0