結果

問題 No.820 Power of Two
ユーザー htensaihtensai
提出日時 2019-11-11 17:45:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 2,352 ms
コンパイル使用メモリ 71,708 KB
実行使用メモリ 56,432 KB
最終ジャッジ日時 2023-10-13 08:07:12
合計ジャッジ時間 4,322 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,904 KB
testcase_01 AC 120 ms
56,404 KB
testcase_02 AC 121 ms
56,432 KB
testcase_03 AC 120 ms
56,404 KB
testcase_04 AC 122 ms
55,784 KB
testcase_05 AC 120 ms
55,788 KB
testcase_06 AC 121 ms
55,872 KB
testcase_07 AC 121 ms
55,752 KB
testcase_08 AC 121 ms
56,232 KB
testcase_09 AC 121 ms
56,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static TreeSet<Integer> primes;
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		double max = Math.pow(2, n);
		double unit = Math.pow(2, k);
	    System.out.println((long)(max / unit));
	}
}
0