結果

問題 No.312 置換処理
ユーザー GrenacheGrenache
提出日時 2015-12-05 00:46:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 5,060 ms
コンパイル使用メモリ 72,284 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-08-09 15:38:14
合計ジャッジ時間 11,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,644 KB
testcase_01 AC 136 ms
55,804 KB
testcase_02 AC 141 ms
55,960 KB
testcase_03 AC 138 ms
55,968 KB
testcase_04 AC 124 ms
56,248 KB
testcase_05 AC 121 ms
56,208 KB
testcase_06 AC 124 ms
55,856 KB
testcase_07 AC 130 ms
55,736 KB
testcase_08 AC 122 ms
55,832 KB
testcase_09 AC 124 ms
55,788 KB
testcase_10 AC 125 ms
56,196 KB
testcase_11 AC 127 ms
55,908 KB
testcase_12 AC 123 ms
55,972 KB
testcase_13 AC 123 ms
55,852 KB
testcase_14 AC 123 ms
55,504 KB
testcase_15 AC 122 ms
55,756 KB
testcase_16 AC 124 ms
55,920 KB
testcase_17 AC 122 ms
56,124 KB
testcase_18 AC 122 ms
56,012 KB
testcase_19 AC 124 ms
56,216 KB
testcase_20 AC 121 ms
55,976 KB
testcase_21 AC 129 ms
53,900 KB
testcase_22 AC 129 ms
55,580 KB
testcase_23 AC 119 ms
55,496 KB
testcase_24 AC 121 ms
55,488 KB
testcase_25 AC 124 ms
56,280 KB
testcase_26 AC 122 ms
54,600 KB
testcase_27 AC 120 ms
55,720 KB
testcase_28 AC 121 ms
54,320 KB
testcase_29 AC 123 ms
55,936 KB
testcase_30 AC 131 ms
56,012 KB
testcase_31 AC 120 ms
55,792 KB
testcase_32 AC 124 ms
55,976 KB
testcase_33 AC 127 ms
55,780 KB
testcase_34 AC 129 ms
55,804 KB
testcase_35 AC 123 ms
53,864 KB
testcase_36 AC 124 ms
55,700 KB
testcase_37 AC 124 ms
55,764 KB
testcase_38 AC 123 ms
55,792 KB
testcase_39 AC 121 ms
54,352 KB
testcase_40 AC 126 ms
55,784 KB
testcase_41 AC 122 ms
56,088 KB
testcase_42 AC 121 ms
56,364 KB
testcase_43 AC 121 ms
55,720 KB
testcase_44 AC 122 ms
55,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder312 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();

        long ret = n;
        if (n != 4 && n % 2 == 0) {
        	ret = n / 2;
        }

        for (long j = 3; j * j <= n; j++) {
        	if (n % j == 0) {
        		System.out.println(Math.min(ret, j));

        		sc.close();
        		return;
        	}
        }

		System.out.println(Math.min(ret, n));

        sc.close();
    }
}
0