結果

問題 No.411 昇順昇順ソート
ユーザー GrenacheGrenache
提出日時 2016-08-13 00:25:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 1,533 bytes
コンパイル時間 4,762 ms
コンパイル使用メモリ 75,156 KB
実行使用メモリ 50,872 KB
最終ジャッジ日時 2023-08-07 12:11:44
合計ジャッジ時間 6,454 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
50,296 KB
testcase_01 AC 53 ms
50,184 KB
testcase_02 AC 54 ms
50,268 KB
testcase_03 AC 55 ms
49,124 KB
testcase_04 AC 53 ms
50,704 KB
testcase_05 AC 54 ms
50,180 KB
testcase_06 AC 54 ms
50,172 KB
testcase_07 AC 55 ms
50,320 KB
testcase_08 AC 54 ms
50,112 KB
testcase_09 AC 52 ms
50,480 KB
testcase_10 AC 53 ms
50,188 KB
testcase_11 AC 54 ms
50,208 KB
testcase_12 AC 53 ms
50,320 KB
testcase_13 AC 53 ms
50,120 KB
testcase_14 AC 53 ms
50,100 KB
testcase_15 AC 53 ms
50,412 KB
testcase_16 AC 54 ms
50,184 KB
testcase_17 AC 54 ms
49,952 KB
testcase_18 AC 53 ms
50,872 KB
testcase_19 AC 54 ms
50,536 KB
testcase_20 AC 53 ms
50,004 KB
testcase_21 AC 53 ms
50,008 KB
testcase_22 AC 53 ms
50,120 KB
testcase_23 AC 54 ms
50,452 KB
testcase_24 AC 55 ms
50,376 KB
testcase_25 AC 53 ms
50,444 KB
testcase_26 AC 55 ms
50,072 KB
testcase_27 AC 54 ms
50,224 KB
testcase_28 AC 55 ms
50,008 KB
testcase_29 AC 54 ms
50,184 KB
testcase_30 AC 53 ms
50,048 KB
testcase_31 AC 53 ms
50,668 KB
testcase_32 AC 53 ms
50,108 KB
testcase_33 AC 54 ms
50,288 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