結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2017-05-01 01:45:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 103 ms / 5,000 ms |
コード長 | 308 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 23,680 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 01:05:06 |
合計ジャッジ時間 | 1,367 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include<cstdio> typedef long long ll; int solve(ll x) { ll i; int c=0; for(i=2;i*i<=x;i++) { for(;x%i==0;x/=i) { c++; if(c>=3) return 1; } } if(x>1) c++; return c>=3; } int main(void) { ll n; while(scanf("%lld", &n)==1) { printf("%s\n", solve(n)?"YES":"NO"); } return 0; }