結果
| 問題 |
No.192 合成数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-08 00:37:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 325 bytes |
| コンパイル時間 | 463 ms |
| コンパイル使用メモリ | 54,884 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-07 15:25:34 |
| 合計ジャッジ時間 | 4,848 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 25 |
ソースコード
#include <iostream>
using namespace std;
bool isComp(int n){
for(int i = 2; i < n; i++){
if(n % i == 0)
return false;
}
return true;
}
int solve(){
int N;
cin >> N;
for(int i = N - 100; i <= N + 100; i++){
if(isComp(i))
return i;
}
return -1;
}
int main(){
cout << solve() << endl;
}