結果

問題 No.136 Yet Another GCD Problem
ユーザー tenten
提出日時 2020-11-17 20:37:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 74,296 KB
実行使用メモリ 54,372 KB
最終ジャッジ日時 2024-07-23 08:27:23
合計ジャッジ時間 8,511 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

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();
        int ans = 1;
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                ans = n / i;
                break;
            }
        }
        System.out.println(ans);
    }
}
0