結果

問題 No.312 置換処理
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-21 03:17:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 2,753 ms
コンパイル使用メモリ 72,656 KB
実行使用メモリ 57,748 KB
最終ジャッジ日時 2023-08-18 06:06:37
合計ジャッジ時間 10,741 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
56,092 KB
testcase_01 AC 142 ms
55,680 KB
testcase_02 AC 145 ms
55,476 KB
testcase_03 AC 144 ms
55,860 KB
testcase_04 AC 128 ms
55,984 KB
testcase_05 AC 129 ms
55,892 KB
testcase_06 AC 131 ms
55,956 KB
testcase_07 AC 137 ms
55,796 KB
testcase_08 AC 128 ms
55,696 KB
testcase_09 AC 130 ms
55,668 KB
testcase_10 AC 129 ms
55,476 KB
testcase_11 AC 133 ms
55,764 KB
testcase_12 AC 130 ms
55,704 KB
testcase_13 AC 131 ms
55,748 KB
testcase_14 AC 126 ms
55,608 KB
testcase_15 AC 127 ms
55,784 KB
testcase_16 AC 128 ms
55,768 KB
testcase_17 AC 128 ms
55,452 KB
testcase_18 AC 128 ms
55,736 KB
testcase_19 AC 129 ms
56,004 KB
testcase_20 AC 128 ms
55,772 KB
testcase_21 AC 127 ms
55,876 KB
testcase_22 AC 126 ms
55,620 KB
testcase_23 WA -
testcase_24 AC 128 ms
55,924 KB
testcase_25 AC 128 ms
55,764 KB
testcase_26 AC 131 ms
55,784 KB
testcase_27 AC 130 ms
55,764 KB
testcase_28 AC 128 ms
55,824 KB
testcase_29 AC 127 ms
55,508 KB
testcase_30 AC 132 ms
55,952 KB
testcase_31 AC 127 ms
57,748 KB
testcase_32 AC 130 ms
56,016 KB
testcase_33 AC 134 ms
55,856 KB
testcase_34 AC 136 ms
55,484 KB
testcase_35 AC 129 ms
55,476 KB
testcase_36 AC 130 ms
57,500 KB
testcase_37 AC 127 ms
55,904 KB
testcase_38 AC 128 ms
56,312 KB
testcase_39 AC 130 ms
56,360 KB
testcase_40 AC 128 ms
55,660 KB
testcase_41 AC 128 ms
55,916 KB
testcase_42 AC 127 ms
55,884 KB
testcase_43 AC 128 ms
55,752 KB
testcase_44 AC 135 ms
55,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long rt = (long)(Math.sqrt(N));
        for(long i=3; i<=rt; i++){
            if(N%i==0){
                System.out.println(i);
                return;
            }
        }
        if(N%2==0){
            N/=2;
        }
        System.out.println(N);
    }
}
0