結果

問題 No.820 Power of Two
ユーザー iwa_choco_168
提出日時 2019-12-03 15:20:24
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 2,206 ms
コンパイル使用メモリ 74,944 KB
実行使用メモリ 54,152 KB
最終ジャッジ日時 2024-11-27 07:34:06
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        if(n < k) System.out.println(0);
        else System.out.println((long)Math.pow(2, n - k));
    }
}
0