結果

問題 No.312 置換処理
ユーザー kou6839kou6839
提出日時 2015-12-05 14:32:02
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 3,595 ms
コンパイル使用メモリ 71,648 KB
実行使用メモリ 58,124 KB
最終ジャッジ日時 2023-10-12 15:42:11
合計ジャッジ時間 9,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 120 ms
55,768 KB
testcase_02 AC 134 ms
55,988 KB
testcase_03 AC 121 ms
55,912 KB
testcase_04 AC 120 ms
55,484 KB
testcase_05 AC 120 ms
55,936 KB
testcase_06 WA -
testcase_07 AC 127 ms
55,948 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 127 ms
56,004 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 124 ms
55,872 KB
testcase_23 AC 123 ms
55,824 KB
testcase_24 AC 122 ms
55,812 KB
testcase_25 AC 124 ms
56,028 KB
testcase_26 AC 122 ms
56,016 KB
testcase_27 AC 123 ms
55,832 KB
testcase_28 AC 122 ms
55,644 KB
testcase_29 AC 122 ms
56,116 KB
testcase_30 AC 123 ms
55,716 KB
testcase_31 WA -
testcase_32 AC 125 ms
55,768 KB
testcase_33 AC 128 ms
55,496 KB
testcase_34 AC 128 ms
55,392 KB
testcase_35 AC 126 ms
55,912 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 121 ms
55,920 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 122 ms
55,508 KB
testcase_43 AC 122 ms
55,616 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		
		for(long i=2;i*i<=n;i++){
			if(n%i==0){
				if(i>2){
				System.out.println(i);
				return;}
				else if(n/i>2){
					System.out.println(n/i);
					return;
				}
			}
		}
		System.out.println(n);
	}
}
0