結果

問題 No.312 置換処理
ユーザー tsunabittsunabit
提出日時 2020-03-28 19:58:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 3,523 ms
コンパイル使用メモリ 75,436 KB
実行使用メモリ 54,364 KB
最終ジャッジ日時 2024-04-27 11:08:00
合計ジャッジ時間 10,997 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
54,200 KB
testcase_01 AC 143 ms
53,992 KB
testcase_02 AC 145 ms
54,148 KB
testcase_03 AC 145 ms
53,916 KB
testcase_04 AC 133 ms
54,020 KB
testcase_05 AC 131 ms
54,012 KB
testcase_06 AC 134 ms
54,068 KB
testcase_07 AC 128 ms
53,148 KB
testcase_08 AC 129 ms
53,868 KB
testcase_09 AC 129 ms
54,344 KB
testcase_10 AC 130 ms
54,244 KB
testcase_11 AC 139 ms
54,164 KB
testcase_12 AC 131 ms
54,168 KB
testcase_13 AC 141 ms
54,200 KB
testcase_14 AC 132 ms
54,080 KB
testcase_15 AC 132 ms
53,988 KB
testcase_16 AC 131 ms
54,168 KB
testcase_17 AC 135 ms
54,120 KB
testcase_18 AC 131 ms
54,132 KB
testcase_19 AC 133 ms
54,004 KB
testcase_20 AC 131 ms
54,036 KB
testcase_21 AC 133 ms
54,096 KB
testcase_22 AC 131 ms
53,884 KB
testcase_23 AC 138 ms
54,364 KB
testcase_24 AC 135 ms
54,272 KB
testcase_25 AC 135 ms
54,144 KB
testcase_26 AC 134 ms
53,864 KB
testcase_27 AC 134 ms
53,848 KB
testcase_28 AC 132 ms
54,008 KB
testcase_29 AC 135 ms
54,068 KB
testcase_30 AC 123 ms
53,016 KB
testcase_31 AC 132 ms
54,080 KB
testcase_32 AC 136 ms
53,788 KB
testcase_33 AC 147 ms
54,296 KB
testcase_34 AC 144 ms
54,072 KB
testcase_35 AC 133 ms
53,956 KB
testcase_36 AC 132 ms
54,152 KB
testcase_37 AC 135 ms
54,192 KB
testcase_38 AC 133 ms
54,000 KB
testcase_39 AC 130 ms
54,280 KB
testcase_40 AC 132 ms
54,284 KB
testcase_41 AC 133 ms
54,148 KB
testcase_42 AC 131 ms
54,120 KB
testcase_43 AC 134 ms
54,172 KB
testcase_44 AC 132 ms
54,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No312 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		
		for(long i = 3; i*i <= n; i++) {
			if(n%i == 0) {
				System.out.println(i);
				return;
			}
		}
		if(n%2 == 0 && n>4) {
			System.out.println(n/2);
			return;
		}
		System.out.println(n);
	}
}
0