結果

問題 No.820 Power of Two
ユーザー edamame882
提出日時 2019-04-26 21:28:27
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 778 bytes
コンパイル時間 1,448 ms
コンパイル使用メモリ 167,496 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 02:02:58
合計ジャッジ時間 1,955 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;


//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
    ll n,k;
    cin >> n >> k;
    ll x = 1<<k;
    ll ans = 0;
    if(x <= 1LL<<n) ans = 1;
    rep(i,n-k) ans*= 2;
    cout << ans << endl;
    return 0;
}
0