結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2015-12-05 01:24:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 517 ms |
コンパイル使用メモリ | 60,616 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 11:47:54 |
合計ジャッジ時間 | 1,758 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
#include <iostream> #include <algorithm> #include <sstream> #include <vector> using namespace std; int main(int argc, char *argv[]) { long long N; cin >> N; long long ans = N; if (N > 4 && (ans % 2) == 0) { ans = N / 2; } for (long long x = 3; x * x <= N; ++x) { if ((N % x) == 0) { ans = x; break; } } cout << ans << endl; return 0; }