結果

問題 No.411 昇順昇順ソート
ユーザー YamaKasaYamaKasa
提出日時 2018-09-19 23:21:59
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 1,908 ms
コンパイル使用メモリ 71,444 KB
実行使用メモリ 56,296 KB
最終ジャッジ日時 2023-09-25 10:17:20
合計ジャッジ時間 7,840 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,700 KB
testcase_01 AC 121 ms
55,948 KB
testcase_02 AC 124 ms
55,764 KB
testcase_03 AC 120 ms
55,576 KB
testcase_04 AC 124 ms
55,808 KB
testcase_05 AC 122 ms
55,972 KB
testcase_06 AC 122 ms
55,576 KB
testcase_07 AC 120 ms
55,820 KB
testcase_08 AC 122 ms
55,872 KB
testcase_09 AC 122 ms
55,932 KB
testcase_10 AC 122 ms
55,252 KB
testcase_11 AC 123 ms
55,748 KB
testcase_12 AC 125 ms
55,908 KB
testcase_13 AC 120 ms
55,880 KB
testcase_14 AC 117 ms
55,900 KB
testcase_15 AC 119 ms
55,932 KB
testcase_16 AC 123 ms
53,648 KB
testcase_17 AC 122 ms
55,464 KB
testcase_18 AC 121 ms
56,280 KB
testcase_19 AC 119 ms
56,016 KB
testcase_20 AC 122 ms
55,568 KB
testcase_21 AC 123 ms
55,976 KB
testcase_22 AC 120 ms
55,620 KB
testcase_23 AC 120 ms
56,100 KB
testcase_24 AC 122 ms
55,860 KB
testcase_25 AC 123 ms
56,296 KB
testcase_26 AC 122 ms
56,072 KB
testcase_27 AC 119 ms
55,708 KB
testcase_28 AC 122 ms
56,084 KB
testcase_29 AC 120 ms
56,284 KB
testcase_30 AC 120 ms
56,080 KB
testcase_31 AC 118 ms
55,668 KB
testcase_32 AC 121 ms
55,752 KB
testcase_33 AC 129 ms
56,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int K = scan.nextInt();
		scan.close();
		int ans;
		if(K == 1) {
			ans = (int)Math.pow(2, N - K) - N;
		}else {
			ans = (int)Math.pow(2, N - K);
		}
		System.out.println(ans);
	}
}
0