結果

問題 No.312 置換処理
ユーザー YamaKasaYamaKasa
提出日時 2018-09-13 19:55:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 1,709 ms
コンパイル使用メモリ 74,500 KB
実行使用メモリ 54,456 KB
最終ジャッジ日時 2024-04-27 10:57:01
合計ジャッジ時間 7,805 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
54,068 KB
testcase_01 AC 118 ms
54,008 KB
testcase_02 AC 117 ms
53,272 KB
testcase_03 AC 125 ms
53,916 KB
testcase_04 AC 111 ms
54,112 KB
testcase_05 AC 120 ms
54,320 KB
testcase_06 AC 119 ms
54,020 KB
testcase_07 AC 121 ms
54,400 KB
testcase_08 AC 102 ms
53,080 KB
testcase_09 AC 113 ms
54,148 KB
testcase_10 AC 107 ms
53,172 KB
testcase_11 AC 120 ms
54,256 KB
testcase_12 AC 116 ms
54,456 KB
testcase_13 AC 106 ms
52,856 KB
testcase_14 AC 114 ms
54,348 KB
testcase_15 AC 113 ms
54,028 KB
testcase_16 AC 118 ms
54,012 KB
testcase_17 AC 108 ms
53,156 KB
testcase_18 AC 106 ms
53,072 KB
testcase_19 AC 114 ms
54,260 KB
testcase_20 AC 108 ms
53,260 KB
testcase_21 AC 103 ms
53,248 KB
testcase_22 AC 109 ms
54,116 KB
testcase_23 AC 108 ms
53,940 KB
testcase_24 AC 109 ms
53,980 KB
testcase_25 AC 105 ms
52,740 KB
testcase_26 AC 117 ms
54,124 KB
testcase_27 AC 110 ms
54,008 KB
testcase_28 AC 104 ms
53,276 KB
testcase_29 AC 103 ms
53,008 KB
testcase_30 AC 113 ms
53,956 KB
testcase_31 AC 104 ms
53,232 KB
testcase_32 AC 114 ms
54,188 KB
testcase_33 AC 108 ms
53,240 KB
testcase_34 AC 122 ms
54,048 KB
testcase_35 AC 108 ms
53,296 KB
testcase_36 AC 113 ms
54,340 KB
testcase_37 AC 111 ms
54,256 KB
testcase_38 AC 109 ms
54,024 KB
testcase_39 AC 114 ms
54,272 KB
testcase_40 AC 106 ms
52,996 KB
testcase_41 AC 98 ms
52,856 KB
testcase_42 AC 115 ms
54,160 KB
testcase_43 AC 118 ms
54,228 KB
testcase_44 AC 123 ms
54,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		scan.close();
		for(long i = 3; i <= Math.sqrt(N); i++) {
			if(N % i == 0) {
				System.out.println(i);
				System.exit(0);
			}
		}
		if(N % 2 == 0 && N != 4) {
			System.out.println(N / 2);
		}else {
			System.out.println(N);
		}

	}
}
0