結果

問題 No.312 置換処理
ユーザー prime_mgmprime_mgm
提出日時 2015-12-24 17:20:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 74,688 KB
実行使用メモリ 51,196 KB
最終ジャッジ日時 2024-04-27 10:38:36
合計ジャッジ時間 6,860 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
50,320 KB
testcase_01 AC 71 ms
50,808 KB
testcase_02 AC 76 ms
50,856 KB
testcase_03 AC 74 ms
50,976 KB
testcase_04 AC 52 ms
49,972 KB
testcase_05 AC 53 ms
50,184 KB
testcase_06 AC 55 ms
50,236 KB
testcase_07 AC 63 ms
49,952 KB
testcase_08 AC 55 ms
50,132 KB
testcase_09 AC 53 ms
50,160 KB
testcase_10 AC 52 ms
50,192 KB
testcase_11 AC 56 ms
50,148 KB
testcase_12 AC 53 ms
50,256 KB
testcase_13 AC 53 ms
50,312 KB
testcase_14 AC 53 ms
50,172 KB
testcase_15 AC 54 ms
49,884 KB
testcase_16 AC 54 ms
50,096 KB
testcase_17 AC 55 ms
50,280 KB
testcase_18 AC 54 ms
49,976 KB
testcase_19 AC 56 ms
50,040 KB
testcase_20 AC 55 ms
49,844 KB
testcase_21 AC 52 ms
50,168 KB
testcase_22 AC 52 ms
50,172 KB
testcase_23 AC 55 ms
50,240 KB
testcase_24 AC 54 ms
50,080 KB
testcase_25 AC 56 ms
50,184 KB
testcase_26 AC 53 ms
50,232 KB
testcase_27 AC 53 ms
50,252 KB
testcase_28 AC 53 ms
50,292 KB
testcase_29 AC 53 ms
49,864 KB
testcase_30 AC 58 ms
50,300 KB
testcase_31 AC 55 ms
50,304 KB
testcase_32 AC 63 ms
49,920 KB
testcase_33 AC 67 ms
51,196 KB
testcase_34 AC 69 ms
50,752 KB
testcase_35 AC 57 ms
50,220 KB
testcase_36 AC 54 ms
50,036 KB
testcase_37 AC 52 ms
50,244 KB
testcase_38 AC 53 ms
49,868 KB
testcase_39 AC 53 ms
49,968 KB
testcase_40 AC 53 ms
50,300 KB
testcase_41 AC 53 ms
50,192 KB
testcase_42 AC 53 ms
49,944 KB
testcase_43 AC 54 ms
50,240 KB
testcase_44 AC 56 ms
50,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class No312 {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		long n = Long.parseLong(br.readLine());
		
		boolean flag = false;
		long ans = n;
		for(long i = 3 ; i*i <= n ; i++){
			if(n % i == 0){
				ans = i;
				flag=true;
				break;
			}
		}
		if(!flag && n%2 == 0 && n!= 4) ans = n / 2;
		
		System.out.println(ans);
	}
}
0