結果

問題 No.312 置換処理
ユーザー happy-beanshappy-beans
提出日時 2017-03-15 19:15:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 3,113 ms
コンパイル使用メモリ 72,404 KB
実行使用メモリ 58,420 KB
最終ジャッジ日時 2023-09-17 03:38:47
合計ジャッジ時間 10,406 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,868 KB
testcase_01 WA -
testcase_02 AC 137 ms
55,732 KB
testcase_03 WA -
testcase_04 AC 124 ms
56,128 KB
testcase_05 AC 124 ms
56,144 KB
testcase_06 AC 125 ms
56,292 KB
testcase_07 AC 133 ms
58,420 KB
testcase_08 AC 126 ms
55,860 KB
testcase_09 AC 122 ms
56,076 KB
testcase_10 AC 126 ms
56,220 KB
testcase_11 AC 127 ms
56,024 KB
testcase_12 AC 124 ms
55,912 KB
testcase_13 AC 125 ms
56,232 KB
testcase_14 AC 125 ms
56,060 KB
testcase_15 AC 122 ms
56,028 KB
testcase_16 AC 124 ms
55,516 KB
testcase_17 AC 124 ms
56,040 KB
testcase_18 AC 124 ms
55,928 KB
testcase_19 AC 126 ms
56,048 KB
testcase_20 AC 124 ms
56,032 KB
testcase_21 AC 124 ms
56,124 KB
testcase_22 AC 124 ms
56,088 KB
testcase_23 AC 123 ms
55,496 KB
testcase_24 AC 125 ms
55,996 KB
testcase_25 WA -
testcase_26 AC 121 ms
55,888 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 123 ms
56,048 KB
testcase_32 AC 127 ms
56,240 KB
testcase_33 AC 132 ms
55,560 KB
testcase_34 AC 130 ms
56,652 KB
testcase_35 AC 125 ms
56,040 KB
testcase_36 AC 125 ms
56,252 KB
testcase_37 AC 122 ms
56,048 KB
testcase_38 AC 125 ms
56,092 KB
testcase_39 AC 124 ms
56,168 KB
testcase_40 AC 123 ms
56,072 KB
testcase_41 AC 125 ms
56,276 KB
testcase_42 AC 124 ms
55,996 KB
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No312 {

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		
		long n = s.nextLong();
		
		long i = 3;
		double sqrt = Math.sqrt(n);
		
		if (i > sqrt) {
			i = n;
		}
		else {
			while (i < sqrt) {
				
				if ((n % i) == 0) break;
				i++;
			}
			if (i == Math.ceil(sqrt)) i = n;
		}
		
		System.out.println(i);
	}
}
0