結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2021-02-21 13:06:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,222 bytes |
| コンパイル時間 | 841 ms |
| コンパイル使用メモリ | 93,244 KB |
| 実行使用メモリ | 9,888 KB |
| 最終ジャッジ日時 | 2024-09-19 12:02:47 |
| 合計ジャッジ時間 | 13,237 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 25 |
ソースコード
#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;
int cnt = 0;
ll x = n;
for(int i = 2; i * i <= n; i++){
while(x % i == 0 && x > 0){
cnt++;
x /= i;
}
}
if(n > 1)cnt++;
if(cnt >= 3){
cout << "YES" << endl;
}else{
cout << "NO" << endl;
}
return 0;
}
mmn15277198