結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
![]() |
提出日時 | 2014-10-08 00:58:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 431 bytes |
コンパイル時間 | 945 ms |
コンパイル使用メモリ | 60,892 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-12-30 08:02:55 |
合計ジャッジ時間 | 109,829 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 8 WA * 1 TLE * 17 |
ソースコード
#include <algorithm> #include <iostream> #include <string.h> #include <math.h> using namespace std; int main(){ long long n; cin>>n; if(n==1){ cout << "NO" << endl; return 0; } int c = 0; if(n%2==0){ c++; } for(int i = 3; i*i <= n; i+=2){ if(n%i==0){ c++; } } if(c<2){ cout << "NO" << endl; return 0; } cout << "YES" << endl; return 0; }