結果
| 問題 | No.36 素数が嫌い! |
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-02-04 02:06:28 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 495 ms |
| コンパイル使用メモリ | 74,660 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-07 23:02:58 |
| 合計ジャッジ時間 | 1,118 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 WA * 2 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
string func(ll n)
{
if (n==1) return "NO";
int cnt=0;
for(ll i=2;i*i<=n;++i) {
int c=0;
if (n%i==0) {
while (n%i==0) { c++; n/=i; }
cnt++;
if (c>1) return "YES";
}
}
if (n>1) cnt++;
return cnt>2 ? "YES" : "NO";
}
int main()
{
ll n;
while (cin>>n) cout<<func(n)<<endl;
}
hogeover30