結果

問題 No.136 Yet Another GCD Problem
ユーザー htensaihtensai
提出日時 2019-12-30 10:53:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 401 bytes
コンパイル時間 5,325 ms
コンパイル使用メモリ 73,572 KB
実行使用メモリ 41,528 KB
最終ジャッジ日時 2024-04-25 11:00:47
合計ジャッジ時間 10,748 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,416 KB
testcase_01 AC 118 ms
39,732 KB
testcase_02 AC 132 ms
41,304 KB
testcase_03 AC 136 ms
41,168 KB
testcase_04 AC 120 ms
40,264 KB
testcase_05 AC 137 ms
41,016 KB
testcase_06 AC 130 ms
41,204 KB
testcase_07 AC 132 ms
41,156 KB
testcase_08 AC 120 ms
39,948 KB
testcase_09 AC 132 ms
41,072 KB
testcase_10 AC 117 ms
40,176 KB
testcase_11 AC 130 ms
41,196 KB
testcase_12 AC 119 ms
39,856 KB
testcase_13 AC 129 ms
41,328 KB
testcase_14 AC 132 ms
41,056 KB
testcase_15 AC 132 ms
41,168 KB
testcase_16 AC 131 ms
41,128 KB
testcase_17 AC 131 ms
40,864 KB
testcase_18 AC 135 ms
41,116 KB
testcase_19 AC 128 ms
40,624 KB
testcase_20 AC 131 ms
40,844 KB
testcase_21 AC 129 ms
41,384 KB
testcase_22 AC 133 ms
41,300 KB
testcase_23 AC 132 ms
41,288 KB
testcase_24 AC 132 ms
40,872 KB
testcase_25 AC 135 ms
41,260 KB
testcase_26 AC 130 ms
41,148 KB
testcase_27 AC 137 ms
41,148 KB
testcase_28 AC 136 ms
41,304 KB
testcase_29 AC 131 ms
41,204 KB
testcase_30 AC 140 ms
41,528 KB
testcase_31 AC 132 ms
41,308 KB
testcase_32 AC 134 ms
41,204 KB
testcase_33 AC 132 ms
41,084 KB
testcase_34 AC 136 ms
41,092 KB
testcase_35 AC 133 ms
41,136 KB
testcase_36 AC 133 ms
40,984 KB
testcase_37 AC 133 ms
41,236 KB
testcase_38 AC 132 ms
41,456 KB
testcase_39 AC 130 ms
40,888 KB
testcase_40 AC 128 ms
41,084 KB
testcase_41 AC 130 ms
40,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                System.out.println(n / i);
                return;
            }
        }
        System.out.println(1);
    }
}
0