結果

問題 No.411 昇順昇順ソート
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:38:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 290 bytes
コンパイル時間 3,090 ms
コンパイル使用メモリ 74,080 KB
実行使用メモリ 54,128 KB
最終ジャッジ日時 2024-04-27 18:22:10
合計ジャッジ時間 7,647 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
53,876 KB
testcase_01 AC 97 ms
52,500 KB
testcase_02 AC 99 ms
53,416 KB
testcase_03 AC 105 ms
54,124 KB
testcase_04 AC 91 ms
52,260 KB
testcase_05 AC 105 ms
52,944 KB
testcase_06 AC 96 ms
52,848 KB
testcase_07 AC 107 ms
53,848 KB
testcase_08 AC 106 ms
53,776 KB
testcase_09 AC 96 ms
52,856 KB
testcase_10 AC 96 ms
54,128 KB
testcase_11 AC 105 ms
53,736 KB
testcase_12 AC 91 ms
52,288 KB
testcase_13 AC 102 ms
53,556 KB
testcase_14 AC 91 ms
52,104 KB
testcase_15 AC 107 ms
53,768 KB
testcase_16 AC 108 ms
54,056 KB
testcase_17 AC 105 ms
53,528 KB
testcase_18 AC 94 ms
52,924 KB
testcase_19 AC 105 ms
54,068 KB
testcase_20 AC 106 ms
54,028 KB
testcase_21 AC 106 ms
53,540 KB
testcase_22 AC 100 ms
52,692 KB
testcase_23 AC 112 ms
53,772 KB
testcase_24 WA -
testcase_25 AC 109 ms
53,976 KB
testcase_26 AC 103 ms
53,848 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 108 ms
54,076 KB
testcase_30 AC 112 ms
53,840 KB
testcase_31 AC 141 ms
54,072 KB
testcase_32 AC 108 ms
53,644 KB
testcase_33 AC 110 ms
54,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt(), k = sc.nextInt(), ans = 1;
		for(int i = k+1; i <= n; i++){
			ans *= 2;
		}
		if(k == 1){
			ans-=2;
		}
		System.out.println(ans);
	}
}
0