結果

問題 No.312 置換処理
ユーザー kuisibakuisiba
提出日時 2016-06-03 12:30:11
言語 C++11
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 514 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 54,976 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-08 06:14:32
合計ジャッジ時間 4,243 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 TLE * 1 -- * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

long long func(long long n) {
    long long p;
    if (n == 3) p = n;
    for (int i = 3; i < n; ++i) {
        if (i * i <= n) {
            if (n % i) {
                continue;
            } else {
                p = i;
                break;
            }
        } else {
            break;
        }
    }
    return p;
}

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0);

    long long n;
    cin >> n;
    cout << func(n) << endl;
    return 0;
}
0