結果

問題 No.411 昇順昇順ソート
ユーザー willowoooo
提出日時 2016-08-21 18:34:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 53,876 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 22:28:16
合計ジャッジ時間 1,644 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main() {
	int N, K;
	cin >> N >> K;
	int ans = 1;
	for (int i = 0; i < N-K; i++)
	{
		ans = ans * 2;
	}
	if (K == 1)
		ans = ans - N;
	cout << ans << endl;
}
0