結果

問題 No.560 ふしぎなナップサック
ユーザー htensaihtensai
提出日時 2019-11-14 21:23:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 3,130 ms
コンパイル使用メモリ 74,992 KB
実行使用メモリ 57,336 KB
最終ジャッジ日時 2023-10-22 00:26:26
合計ジャッジ時間 5,796 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
56,972 KB
testcase_01 AC 113 ms
56,976 KB
testcase_02 AC 111 ms
57,004 KB
testcase_03 AC 113 ms
57,060 KB
testcase_04 AC 106 ms
56,352 KB
testcase_05 AC 115 ms
57,060 KB
testcase_06 AC 114 ms
57,336 KB
testcase_07 AC 104 ms
56,324 KB
testcase_08 AC 103 ms
56,280 KB
testcase_09 AC 115 ms
57,048 KB
testcase_10 AC 114 ms
57,048 KB
testcase_11 AC 115 ms
57,044 KB
testcase_12 AC 113 ms
57,044 KB
testcase_13 AC 118 ms
55,540 KB
testcase_14 AC 103 ms
56,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		double m = sc.nextInt();
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
		    m = m * 2 / 3 + (m + 1) / 3;
		}
		System.out.println(m);
	}
}
0