結果
問題 |
No.192 合成数
|
ユーザー |
|
提出日時 | 2020-12-03 09:33:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 1,786 ms |
コンパイル使用メモリ | 165,736 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 17:17:12 |
合計ジャッジ時間 | 2,604 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 |
ソースコード
// yukicoder NO.192 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 1; int lim1 = n - 100; int lim2 = n + 1000; bool flag = false; for (int i = lim1; i <= lim2; ++i) { for (int j = 2; j < i; ++j) { if (i % j == 0 && i > 3) { ans = i; flag = true; break; } else continue; } if (flag) break; else continue; } cout << ans << "\n"; return 0; }