結果
問題 | No.312 置換処理 |
ユーザー |
|
提出日時 | 2018-09-08 12:45:29 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 458 bytes |
コンパイル時間 | 464 ms |
コンパイル使用メモリ | 59,668 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 22:32:29 |
合計ジャッジ時間 | 2,176 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 WA * 5 |
ソースコード
#include <iostream> #include <cmath> typedef long long dlong; int main(int argc, char const* argv[]) { dlong n; std::cin >> n; if (n % 4 == 0 && n % 3 != 0) { std::cout << 4 << std::endl; return 0; } dlong ans = n; dlong imax = sqrt(n); for (dlong i = 3; i <= imax; i+=2) { if (n % i == 0) { ans = i; break; } } std::cout << ans << std::endl; return 0; }