結果
問題 | No.36 素数が嫌い! |
ユーザー |
![]() |
提出日時 | 2015-05-28 01:19:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 101 ms / 5,000 ms |
コード長 | 290 bytes |
コンパイル時間 | 384 ms |
コンパイル使用メモリ | 54,232 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 00:18:31 |
合計ジャッジ時間 | 1,647 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <iostream> using namespace std; typedef long long int ll; int main(){ ll n; cin>>n; ll cnt=0; for(ll i=2;i*i<=n;i++){ while(n%i==0){ n/=i; cnt++; if(cnt>2) goto end; } } end:; if(n>=2) cnt++; if(cnt>=3) cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }