結果

問題 No.312 置換処理
ユーザー 37zigen37zigen
提出日時 2016-03-22 02:58:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 1,686 ms
コンパイル使用メモリ 74,164 KB
実行使用メモリ 54,568 KB
最終ジャッジ日時 2024-04-27 10:41:47
合計ジャッジ時間 7,695 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
53,052 KB
testcase_01 AC 121 ms
53,108 KB
testcase_02 AC 138 ms
54,092 KB
testcase_03 AC 120 ms
53,460 KB
testcase_04 AC 95 ms
52,692 KB
testcase_05 AC 100 ms
52,612 KB
testcase_06 AC 102 ms
52,740 KB
testcase_07 AC 109 ms
53,136 KB
testcase_08 AC 112 ms
54,200 KB
testcase_09 AC 102 ms
53,132 KB
testcase_10 AC 109 ms
53,944 KB
testcase_11 AC 119 ms
54,336 KB
testcase_12 AC 101 ms
53,044 KB
testcase_13 AC 96 ms
52,356 KB
testcase_14 AC 115 ms
53,964 KB
testcase_15 AC 108 ms
54,132 KB
testcase_16 AC 99 ms
52,900 KB
testcase_17 AC 103 ms
52,948 KB
testcase_18 AC 113 ms
54,152 KB
testcase_19 AC 111 ms
54,240 KB
testcase_20 AC 107 ms
54,316 KB
testcase_21 AC 105 ms
53,796 KB
testcase_22 AC 114 ms
54,568 KB
testcase_23 AC 102 ms
52,816 KB
testcase_24 AC 105 ms
52,732 KB
testcase_25 AC 109 ms
54,004 KB
testcase_26 AC 109 ms
54,244 KB
testcase_27 AC 105 ms
52,848 KB
testcase_28 AC 114 ms
54,268 KB
testcase_29 AC 111 ms
54,132 KB
testcase_30 AC 126 ms
54,188 KB
testcase_31 AC 103 ms
53,076 KB
testcase_32 AC 116 ms
54,276 KB
testcase_33 AC 123 ms
54,156 KB
testcase_34 AC 110 ms
53,580 KB
testcase_35 AC 111 ms
54,040 KB
testcase_36 AC 100 ms
54,056 KB
testcase_37 AC 105 ms
54,156 KB
testcase_38 AC 109 ms
54,052 KB
testcase_39 AC 108 ms
54,276 KB
testcase_40 AC 113 ms
54,136 KB
testcase_41 AC 110 ms
54,088 KB
testcase_42 AC 107 ms
54,152 KB
testcase_43 AC 107 ms
53,888 KB
testcase_44 AC 107 ms
53,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		long ans=0;
		for(int i=3;i<=Math.sqrt((double)n);i++){
			if(n%i==0){
				ans=i;
				break;
			}
		}
		if(ans==0){
			if(n%2==0&&n/2!=2){
				ans=n/2;
			}else{
				ans=n;
			}
		}
		System.out.println(ans);

	}
}	
0