結果

問題 No.312 置換処理
ユーザー _k_a_n_i__k_a_n_i_
提出日時 2015-12-06 23:02:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 71,492 KB
実行使用メモリ 60,164 KB
最終ジャッジ日時 2023-10-12 17:35:46
合計ジャッジ時間 9,435 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,824 KB
testcase_01 AC 140 ms
55,668 KB
testcase_02 WA -
testcase_03 AC 140 ms
55,500 KB
testcase_04 WA -
testcase_05 AC 128 ms
56,184 KB
testcase_06 AC 124 ms
55,488 KB
testcase_07 AC 131 ms
56,160 KB
testcase_08 AC 126 ms
55,460 KB
testcase_09 AC 126 ms
55,668 KB
testcase_10 AC 127 ms
56,040 KB
testcase_11 AC 127 ms
55,800 KB
testcase_12 AC 125 ms
55,476 KB
testcase_13 AC 124 ms
55,672 KB
testcase_14 AC 127 ms
55,612 KB
testcase_15 AC 124 ms
55,892 KB
testcase_16 AC 123 ms
55,792 KB
testcase_17 AC 123 ms
55,700 KB
testcase_18 AC 123 ms
55,476 KB
testcase_19 AC 125 ms
56,348 KB
testcase_20 AC 126 ms
55,696 KB
testcase_21 AC 127 ms
55,820 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 122 ms
55,736 KB
testcase_26 WA -
testcase_27 AC 126 ms
55,624 KB
testcase_28 AC 126 ms
55,772 KB
testcase_29 AC 125 ms
56,128 KB
testcase_30 AC 127 ms
55,976 KB
testcase_31 AC 120 ms
55,764 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 125 ms
55,732 KB
testcase_36 AC 126 ms
55,780 KB
testcase_37 AC 124 ms
55,516 KB
testcase_38 AC 124 ms
56,148 KB
testcase_39 AC 125 ms
55,952 KB
testcase_40 AC 125 ms
55,820 KB
testcase_41 AC 125 ms
56,068 KB
testcase_42 AC 127 ms
55,936 KB
testcase_43 AC 123 ms
55,696 KB
testcase_44 AC 122 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main
{
    private final static Main main = new Main();

    public static void main(String[] args)
    {
        main.contest();
    }

    private void contest()
    {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        System.out.println(Math.min(solve(n), n/2));
    }

    private long solve(long n)
    {
        for(int i=3; i<=Math.sqrt(n)+1; ++i)
        {
            if(n%i == 0)
            {
                return i;
            }
        }
        return n;
    }
}
0