結果

問題 No.312 置換処理
ユーザー gu_21816943gu_21816943
提出日時 2017-06-28 00:29:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 619 bytes
コンパイル時間 1,981 ms
コンパイル使用メモリ 75,008 KB
実行使用メモリ 51,332 KB
最終ジャッジ日時 2024-04-27 10:52:25
合計ジャッジ時間 5,690 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
50,400 KB
testcase_01 AC 71 ms
51,144 KB
testcase_02 AC 75 ms
51,036 KB
testcase_03 AC 77 ms
51,332 KB
testcase_04 AC 54 ms
50,440 KB
testcase_05 AC 55 ms
50,008 KB
testcase_06 AC 56 ms
50,512 KB
testcase_07 AC 64 ms
50,600 KB
testcase_08 AC 53 ms
50,232 KB
testcase_09 AC 53 ms
50,316 KB
testcase_10 AC 54 ms
50,160 KB
testcase_11 AC 57 ms
50,300 KB
testcase_12 AC 54 ms
50,424 KB
testcase_13 AC 54 ms
50,536 KB
testcase_14 AC 54 ms
50,460 KB
testcase_15 AC 53 ms
50,444 KB
testcase_16 AC 54 ms
50,520 KB
testcase_17 AC 57 ms
50,008 KB
testcase_18 AC 53 ms
50,436 KB
testcase_19 AC 54 ms
50,336 KB
testcase_20 AC 54 ms
50,384 KB
testcase_21 AC 53 ms
50,220 KB
testcase_22 AC 53 ms
50,188 KB
testcase_23 AC 56 ms
50,464 KB
testcase_24 AC 53 ms
50,416 KB
testcase_25 AC 55 ms
50,352 KB
testcase_26 AC 54 ms
50,388 KB
testcase_27 AC 54 ms
50,492 KB
testcase_28 AC 52 ms
50,448 KB
testcase_29 AC 53 ms
50,420 KB
testcase_30 AC 59 ms
50,480 KB
testcase_31 AC 53 ms
50,160 KB
testcase_32 AC 57 ms
50,036 KB
testcase_33 AC 64 ms
50,500 KB
testcase_34 AC 64 ms
50,616 KB
testcase_35 AC 53 ms
50,424 KB
testcase_36 AC 54 ms
50,004 KB
testcase_37 AC 53 ms
50,116 KB
testcase_38 AC 53 ms
50,096 KB
testcase_39 AC 53 ms
50,028 KB
testcase_40 AC 54 ms
50,092 KB
testcase_41 AC 54 ms
50,300 KB
testcase_42 AC 52 ms
50,512 KB
testcase_43 AC 52 ms
50,288 KB
testcase_44 AC 59 ms
50,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

class Main {
	static PrintWriter out = new PrintWriter(System.out);
	static String str;

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long len = Long.parseLong(br.readLine());

		int i;
		double sqr=Math.sqrt(len);
		for(i=3;i<=sqr;i++){
			if(len%i==0){
				System.out.println(i);
				return;
			}
		}
		if(len%2==0&&len!=4){
			System.out.println(len/2);
			return;
		}
		System.out.println(len);
	}
}
0