結果

問題 No.136 Yet Another GCD Problem
ユーザー tsunabit
提出日時 2020-03-04 21:34:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 342 bytes
コンパイル時間 3,340 ms
コンパイル使用メモリ 78,996 KB
実行使用メモリ 41,680 KB
最終ジャッジ日時 2024-10-14 00:30:31
合計ジャッジ時間 9,768 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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