結果

問題 No.36 素数が嫌い!
ユーザー mmn15277198mmn15277198
提出日時 2021-02-21 16:41:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,221 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 95,912 KB
実行使用メモリ 7,780 KB
最終ジャッジ日時 2023-10-19 18:22:47
合計ジャッジ時間 13,710 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
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 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<math.h>
#include<iomanip>
#include<stack>
#include<queue>
#include<set>
#include<map>
 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
//const ll mod = 1000000007;
const ll mod = 998244353;
const ld pi = 3.14159265358979;

ll gcd(ll a , ll b){
	if(a < b)swap(a , b);
	if(b == 0)return 1;
	if(a % b == 0)return b;
	else return gcd(b , a % b);
}

bool isPrime(ll x){
	if(x == 2 || x == 3 || x == 5 || x == 7){
		return true;
	}
	for(int i = 3; i * i <= x; i++){
		if(x % i == 0)return false;
	}
	return true;
}

/*
vector<int> divisor(ll x){
	vector<int> ret;
	ll n = x;
	for(int i = 2; i * i <= x; i++){
		while(n % i == 0){
			ret.push_back(i);
			n /= i;
		}
	}
	if(n > 1)ret.push_back(n);
	return ret;
}
*/

int main(){	
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
	ll n;
	cin >> n;
	vector<int> ret;
	for(int i = 2; i * i <= n; i++){
		while(n % i == 0){
			ret.push_back(i);
			n /= i;
		}
	}
	if(n > 1)ret.push_back(n);
	if(ret.size() >= 3)cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}
0