結果

問題 No.820 Power of Two
ユーザー penguinshunya
提出日時 2019-05-19 12:57:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 1,830 ms
コンパイル使用メモリ 191,264 KB
最終ジャッジ日時 2025-01-07 03:46:33
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  int N, K;
  cin >> N >> K;
  int ans = 1;
  for (int i = 0; i < N; i++) {
    ans *= 2;
  }
  for (int i = 0; i < K; i++) {
    ans /= 2;
  }
  cout << ans << '\n';
  return 0;
}
0