結果

問題 No.477 MVP
ユーザー shinwisteriashinwisteria
提出日時 2017-03-21 13:11:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 327 bytes
コンパイル時間 3,852 ms
コンパイル使用メモリ 71,944 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-09-18 14:42:44
合計ジャッジ時間 6,335 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,892 KB
testcase_01 AC 124 ms
55,996 KB
testcase_02 AC 122 ms
55,864 KB
testcase_03 AC 122 ms
55,900 KB
testcase_04 AC 122 ms
56,112 KB
testcase_05 AC 121 ms
55,764 KB
testcase_06 AC 125 ms
55,908 KB
testcase_07 AC 121 ms
55,860 KB
testcase_08 AC 121 ms
56,048 KB
testcase_09 AC 126 ms
56,144 KB
testcase_10 AC 124 ms
56,088 KB
testcase_11 AC 124 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class MVP {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long N = s.nextLong();
		long K = s.nextLong();
		long i;
		s.close();
		for(i = 1;;i++){
			long D = (N/(K+1) + i);
			if(D*(K+1) > N){
				break;
			}
		}

		System.out.println(N/(K+1) + i);
	}

}
0