結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2015-02-04 02:00:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 276 bytes |
| コンパイル時間 | 500 ms |
| コンパイル使用メモリ | 54,236 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 07:22:01 |
| 合計ジャッジ時間 | 1,724 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 9 |
ソースコード
#include <iostream>
using namespace std;
typedef long long ll;
bool isPrime(ll n)
{
if (n==1) return true;
for(ll i=2;i*i<=n;++i)
if (n%i==0) return false;
return true;
}
int main()
{
ll n;
while (cin>>n) cout<<(isPrime(n) ? "NO" : "YES")<<endl;
}
hogeover30