結果

問題 No.820 Power of Two
ユーザー shinwisteriashinwisteria
提出日時 2019-08-30 09:48:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 3,688 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 41,456 KB
最終ジャッジ日時 2024-04-30 01:19:57
合計ジャッジ時間 5,934 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 143 ms
41,208 KB
testcase_01 AC 140 ms
41,132 KB
testcase_02 AC 140 ms
41,276 KB
testcase_03 AC 145 ms
41,380 KB
testcase_04 AC 138 ms
41,108 KB
testcase_05 AC 142 ms
41,188 KB
testcase_06 AC 141 ms
41,456 KB
testcase_07 AC 139 ms
41,404 KB
testcase_08 AC 138 ms
41,420 KB
testcase_09 AC 141 ms
41,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package con_level_1;
import java.util.Scanner;

public class Con820 {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int N = s.nextInt() , K = s.nextInt();
		s.close();

		if(N >= K){
			double n = Math.pow(2, N) , k = Math.pow(2, K);
			System.out.println((int)(n / k));

		}else{
			System.out.println(0);
		}
	}
}
0