結果

問題 No.820 Power of Two
コンテスト
ユーザー Mayimg
提出日時 2019-04-26 21:24:44
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 361 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,262 ms
コンパイル使用メモリ 211,428 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-10-13 03:54:10
合計ジャッジ時間 7,542 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (k == 0) {
    cout << (int) pow(2, n) << endl;
    return 0;
  }
  int t = pow(2, k);
  int ans = 0;
  int v = pow(2, n);
  while ((ans + 1) * t <= v) ans++;
  cout << ans << endl;
  return 0; 
}
0