結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2016-09-28 10:07:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 102 ms / 5,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 57,656 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-27 00:49:07 |
合計ジャッジ時間 | 1,902 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main(){ ll N;cin>>N; string ans="NO"; ll cnt=0; ll N2=N; for(ll i=2;i*i<N;++i){ if(cnt>1){ ans="YES"; break; } if(N2==1) break; if(N2%i==0){ while(1){ if(N2%i!=0) break; N2/=i; cnt+=1; } } } cout<<ans<<endl; return 0; }