結果
| 問題 |
No.36 素数が嫌い!
|
| コンテスト | |
| ユーザー |
tubo28
|
| 提出日時 | 2014-10-08 00:55:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 409 bytes |
| コンパイル時間 | 681 ms |
| コンパイル使用メモリ | 54,100 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-30 07:56:49 |
| 合計ジャッジ時間 | 1,979 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 WA * 9 |
ソースコード
#include <iostream>
using namespace std;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
typedef long long ll;
bool isp(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 << (isp(N) ? "NO" : "YES") << endl;
}
}
tubo28