結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
39,944 KB
testcase_01 AC 135 ms
41,000 KB
testcase_02 AC 141 ms
41,044 KB
testcase_03 AC 138 ms
41,400 KB
testcase_04 AC 113 ms
39,932 KB
testcase_05 AC 130 ms
40,924 KB
testcase_06 AC 119 ms
40,020 KB
testcase_07 AC 139 ms
40,996 KB
testcase_08 AC 133 ms
40,928 KB
testcase_09 AC 130 ms
41,260 KB
testcase_10 AC 131 ms
41,160 KB
testcase_11 AC 132 ms
40,912 KB
testcase_12 AC 132 ms
41,068 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 127 ms
41,024 KB
testcase_23 WA -
testcase_24 AC 130 ms
41,040 KB
testcase_25 AC 126 ms
41,252 KB
testcase_26 AC 128 ms
41,172 KB
testcase_27 AC 132 ms
40,860 KB
testcase_28 AC 129 ms
41,364 KB
testcase_29 AC 127 ms
40,720 KB
testcase_30 AC 134 ms
41,292 KB
testcase_31 WA -
testcase_32 AC 136 ms
40,900 KB
testcase_33 AC 138 ms
41,188 KB
testcase_34 AC 135 ms
41,212 KB
testcase_35 AC 131 ms
41,360 KB
testcase_36 AC 130 ms
41,220 KB
testcase_37 AC 128 ms
41,544 KB
testcase_38 WA -
testcase_39 AC 132 ms
41,236 KB
testcase_40 AC 132 ms
41,148 KB
testcase_41 AC 119 ms
39,948 KB
testcase_42 AC 115 ms
39,780 KB
testcase_43 AC 128 ms
41,140 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%2==0?n/2:n);
	}
}
0