結果
問題 |
No.36 素数が嫌い!
|
ユーザー |
|
提出日時 | 2016-08-10 08:16:46 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 762 ms |
コンパイル使用メモリ | 54,364 KB |
実行使用メモリ | 8,320 KB |
最終ジャッジ日時 | 2024-11-07 08:25:42 |
合計ジャッジ時間 | 7,361 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 5 TLE * 1 -- * 20 |
ソースコード
#include <iostream> using namespace std; typedef long long ll; bool prime(int a){ for(int i=2; i<a; ++i){ if(a%i==0){ return false; } } return true; } int main(){ ll n; cin>>n; for(int i=2; i<n; ++i){ if(n%i==0){ if(prime(i)==false){ cout<<"YES"<<endl; return 0; } } } cout<<"NO"<<endl; return 0; }