結果

問題 No.820 Power of Two
ユーザー dgd1724
提出日時 2019-09-26 21:21:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 2,630 ms
コンパイル使用メモリ 61,368 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 06:21:59
合計ジャッジ時間 1,201 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <fstream>
#include <iostream>
#include <utility> //pair
#include <string>
#include <cmath> //pow


int main() {

	//std::ifstream inf("Text.txt");	std::cin.rdbuf(inf.rdbuf());
	int N, K;
	std::cin >> N >> K;

	if (N - K < 0) {
		std::cout << 0 << std::endl;
	}
	else {
		std::cout << static_cast<int>(std::pow(2, N - K)) << std::endl;
	}

}
0