結果

問題 No.820 Power of Two
ユーザー 37zigen37zigen
提出日時 2019-04-26 21:24:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 2,088 ms
コンパイル使用メモリ 71,664 KB
実行使用メモリ 56,060 KB
最終ジャッジ日時 2023-08-16 12:55:02
合計ジャッジ時間 4,024 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,576 KB
testcase_01 AC 117 ms
55,828 KB
testcase_02 AC 117 ms
56,024 KB
testcase_03 AC 117 ms
55,960 KB
testcase_04 AC 125 ms
55,856 KB
testcase_05 AC 117 ms
55,832 KB
testcase_06 AC 116 ms
55,788 KB
testcase_07 AC 116 ms
55,788 KB
testcase_08 AC 116 ms
56,060 KB
testcase_09 AC 118 ms
55,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main(String[] args) throws Exception {
		new Main().run();
	}

	void run() throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		System.out.println(n >= k ? 1L << (n - k) : 0);
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0