結果

問題 No.312 置換処理
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-23 19:08:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 342 bytes
コンパイル時間 2,073 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 41,448 KB
最終ジャッジ日時 2024-04-29 21:05:17
合計ジャッジ時間 9,118 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
39,652 KB
testcase_01 AC 125 ms
40,144 KB
testcase_02 AC 142 ms
41,284 KB
testcase_03 AC 142 ms
41,092 KB
testcase_04 AC 130 ms
40,916 KB
testcase_05 AC 130 ms
41,000 KB
testcase_06 AC 129 ms
40,912 KB
testcase_07 AC 135 ms
40,948 KB
testcase_08 AC 128 ms
40,924 KB
testcase_09 AC 127 ms
40,944 KB
testcase_10 AC 127 ms
41,088 KB
testcase_11 AC 130 ms
41,212 KB
testcase_12 AC 127 ms
40,920 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 124 ms
40,960 KB
testcase_23 AC 133 ms
40,944 KB
testcase_24 AC 118 ms
39,960 KB
testcase_25 AC 120 ms
39,844 KB
testcase_26 AC 129 ms
41,032 KB
testcase_27 AC 127 ms
40,880 KB
testcase_28 AC 125 ms
41,096 KB
testcase_29 AC 129 ms
40,800 KB
testcase_30 AC 122 ms
39,988 KB
testcase_31 WA -
testcase_32 AC 117 ms
40,000 KB
testcase_33 AC 133 ms
41,260 KB
testcase_34 AC 136 ms
41,092 KB
testcase_35 AC 116 ms
39,932 KB
testcase_36 AC 127 ms
41,224 KB
testcase_37 AC 126 ms
40,840 KB
testcase_38 WA -
testcase_39 AC 128 ms
41,076 KB
testcase_40 AC 127 ms
41,236 KB
testcase_41 AC 127 ms
40,816 KB
testcase_42 AC 125 ms
41,164 KB
testcase_43 AC 117 ms
40,104 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		long n=scanner.nextLong();
		for(int i=3;i<=Math.sqrt(n);i+=2) {
			if(n%i==0) {
				System.out.println(i);
				return;
			}
		}
		System.out.println(n>4&&n%2==0?n/2:n);
	}
}
0