結果
| 問題 |
No.411 昇順昇順ソート
|
| コンテスト | |
| ユーザー |
femto
|
| 提出日時 | 2016-08-13 00:09:41 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 457 bytes |
| コンパイル時間 | 648 ms |
| コンパイル使用メモリ | 76,240 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 16:03:24 |
| 合計ジャッジ時間 | 1,607 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, K;
cin >> N >> K;
if(N == 2 && K == 1) {
cout << 0 << endl;
return 0;
}
if(K == 1) {
int a = 0;
for(int i = 3; i <= N; i++) {
a = a * 2 + i - 2;
}
cout << a << endl;
}
else {
cout << (1 << (N - K)) << endl;
}
}
femto