結果
| 問題 |
No.411 昇順昇順ソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-24 00:33:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 371 bytes |
| コンパイル時間 | 2,006 ms |
| コンパイル使用メモリ | 191,376 KB |
| 最終ジャッジ日時 | 2025-01-12 04:47:55 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 27 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k;
int ret = 0;
if (k == 1) {
int x = 1<<(n-1);
x -= 2;
x -= n-2;
ret = x * 2 + n - 2;
} else {
ret = 1<<(n-k);
}
cout << ret << endl;
return 0;
}