結果

問題 No.312 置換処理
ユーザー maine_honzukimaine_honzuki
提出日時 2021-05-16 15:53:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 191,732 KB
最終ジャッジ日時 2025-01-21 13:11:54
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

//https://ncode.syosetu.com/n4830bu/312/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ll N;
    cin >> N;
    for (ll i = 3; i * i <= N; i++) {
        if (N % i == 0) {
            cout << i << endl;
            return 0;
        }
    }
    if (N % 2 == 0 && N / 2 != 2)
        N /= 2;
    cout << N << endl;
}
0