結果

問題 No.820 Power of Two
ユーザー GodNegotoGodNegoto
提出日時 2019-11-08 14:03:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 4,033 ms
コンパイル使用メモリ 72,092 KB
実行使用メモリ 57,568 KB
最終ジャッジ日時 2023-10-13 03:11:51
合計ジャッジ時間 5,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,192 KB
testcase_01 AC 126 ms
55,756 KB
testcase_02 AC 124 ms
55,872 KB
testcase_03 AC 125 ms
55,700 KB
testcase_04 AC 125 ms
55,792 KB
testcase_05 AC 125 ms
55,976 KB
testcase_06 AC 127 ms
55,984 KB
testcase_07 AC 125 ms
55,472 KB
testcase_08 AC 130 ms
57,568 KB
testcase_09 AC 126 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package algo;

import java.util.Scanner;

public class sample7 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		
		if(Math.pow(2, N) >= (Math.pow(2, K))) {
			System.out.println((int)((Math.pow(2, N)) / (Math.pow(2, K))));
		}
		else {
			System.out.println(0);
		}
	}
}
0