結果

問題 No.411 昇順昇順ソート
ユーザー GrenacheGrenache
提出日時 2016-08-13 00:25:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 1,533 bytes
コンパイル時間 3,767 ms
コンパイル使用メモリ 78,876 KB
実行使用メモリ 37,656 KB
最終ジャッジ日時 2024-04-25 06:01:29
合計ジャッジ時間 6,971 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
36,984 KB
testcase_01 AC 63 ms
37,328 KB
testcase_02 AC 66 ms
37,468 KB
testcase_03 AC 64 ms
37,112 KB
testcase_04 AC 62 ms
37,460 KB
testcase_05 AC 63 ms
36,868 KB
testcase_06 AC 61 ms
37,444 KB
testcase_07 AC 60 ms
37,096 KB
testcase_08 AC 62 ms
37,388 KB
testcase_09 AC 62 ms
37,480 KB
testcase_10 AC 61 ms
37,368 KB
testcase_11 AC 61 ms
37,656 KB
testcase_12 AC 61 ms
37,348 KB
testcase_13 AC 65 ms
37,616 KB
testcase_14 AC 65 ms
37,288 KB
testcase_15 AC 60 ms
37,384 KB
testcase_16 AC 60 ms
37,504 KB
testcase_17 AC 62 ms
37,072 KB
testcase_18 AC 64 ms
37,016 KB
testcase_19 AC 61 ms
37,320 KB
testcase_20 AC 62 ms
37,536 KB
testcase_21 AC 61 ms
37,492 KB
testcase_22 AC 62 ms
37,504 KB
testcase_23 AC 62 ms
37,144 KB
testcase_24 AC 60 ms
36,976 KB
testcase_25 AC 61 ms
37,428 KB
testcase_26 AC 62 ms
37,156 KB
testcase_27 AC 61 ms
37,616 KB
testcase_28 AC 62 ms
37,240 KB
testcase_29 AC 60 ms
37,224 KB
testcase_30 AC 62 ms
37,656 KB
testcase_31 AC 61 ms
37,304 KB
testcase_32 AC 64 ms
37,488 KB
testcase_33 AC 63 ms
37,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder411 {

    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	Printer pr = new Printer(System.out);

    	int n = sc.nextInt();
    	int k = sc.nextInt();

    	if (k == 1) {
    		pr.println((0x1 << (n - k)) - n);
    	} else {
    		pr.println(0x1 << (n - k));
    	}

        pr.close();
        sc.close();
    }

	@SuppressWarnings("unused")
	private static class Scanner {
		BufferedReader br;
		Iterator<String> it;

		Scanner (InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}

		String next() throws RuntimeException  {
			try {
				if (it == null || !it.hasNext()) {
//					it = Arrays.asList(br.readLine().split(" ")).iterator();
					it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).iterator();
				}
				return it.next();
			} catch (IOException e) {
				throw new IllegalStateException();
			}
		}

		int nextInt() throws RuntimeException {
			return Integer.parseInt(next());
		}

		long nextLong() throws RuntimeException {
			return Long.parseLong(next());
		}

		float nextFloat() throws RuntimeException {
			return Float.parseFloat(next());
		}

		double nextDouble() throws RuntimeException {
			return Double.parseDouble(next());
		}

		void close() {
			try {
				br.close();
			} catch (IOException e) {
//				throw new IllegalStateException();
			}
		}
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0