結果

問題 No.312 置換処理
ユーザー kou6839kou6839
提出日時 2015-12-05 14:34:07
言語 Java19
(openjdk 21)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 1,979 ms
コンパイル使用メモリ 71,616 KB
実行使用メモリ 56,432 KB
最終ジャッジ日時 2023-08-09 15:41:37
合計ジャッジ時間 9,608 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
55,980 KB
testcase_01 AC 131 ms
55,648 KB
testcase_02 AC 133 ms
55,864 KB
testcase_03 AC 138 ms
55,724 KB
testcase_04 AC 123 ms
55,948 KB
testcase_05 AC 137 ms
55,756 KB
testcase_06 AC 135 ms
55,944 KB
testcase_07 AC 136 ms
55,792 KB
testcase_08 AC 135 ms
55,956 KB
testcase_09 AC 133 ms
56,164 KB
testcase_10 AC 132 ms
55,940 KB
testcase_11 AC 137 ms
53,872 KB
testcase_12 AC 134 ms
55,936 KB
testcase_13 AC 136 ms
55,976 KB
testcase_14 AC 135 ms
56,240 KB
testcase_15 AC 131 ms
56,300 KB
testcase_16 AC 130 ms
56,084 KB
testcase_17 AC 136 ms
55,584 KB
testcase_18 AC 140 ms
56,232 KB
testcase_19 AC 137 ms
55,720 KB
testcase_20 AC 141 ms
56,092 KB
testcase_21 AC 140 ms
56,384 KB
testcase_22 AC 125 ms
56,432 KB
testcase_23 AC 125 ms
55,936 KB
testcase_24 AC 124 ms
55,788 KB
testcase_25 AC 123 ms
56,012 KB
testcase_26 AC 121 ms
56,168 KB
testcase_27 AC 124 ms
55,548 KB
testcase_28 AC 122 ms
55,744 KB
testcase_29 AC 121 ms
55,844 KB
testcase_30 AC 130 ms
56,040 KB
testcase_31 AC 130 ms
55,976 KB
testcase_32 AC 127 ms
56,072 KB
testcase_33 AC 131 ms
55,584 KB
testcase_34 AC 130 ms
55,756 KB
testcase_35 AC 130 ms
55,764 KB
testcase_36 AC 122 ms
55,944 KB
testcase_37 AC 122 ms
56,120 KB
testcase_38 AC 124 ms
55,776 KB
testcase_39 AC 130 ms
55,892 KB
testcase_40 AC 124 ms
56,144 KB
testcase_41 AC 122 ms
55,964 KB
testcase_42 AC 122 ms
55,904 KB
testcase_43 AC 121 ms
56,108 KB
testcase_44 AC 123 ms
55,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		
		long ans = n;
		for(long i=2;i*i<=n;i++){
			if(n%i==0){
				if(i>2){
				ans=Math.min(ans, i);
				}
				else if(n/i>2){
					ans=Math.min(ans, n/i);
				}
			}
		}
		System.out.println(ans);
	}
}
0