結果

問題 No.820 Power of Two
ユーザー shinwisteria
提出日時 2019-08-30 09:48:01
言語 Java
(openjdk 23)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 3,273 ms
コンパイル使用メモリ 74,472 KB
実行使用メモリ 41,724 KB
最終ジャッジ日時 2024-11-19 11:56:15
合計ジャッジ時間 5,403 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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