結果

問題 No.820 Power of Two
ユーザー kami_apkkami_apk
提出日時 2019-04-27 20:14:04
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 493 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 66,800 KB
実行使用メモリ 814,196 KB
最終ジャッジ日時 2023-08-19 17:37:34
合計ジャッジ時間 5,703 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>

using namespace std;
typedef long long ll;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    ll N,K;
    cin >> N >> K;
    ll Z = pow(2,N);
    ll X = pow(2,K);
    ll flag = 0;
    ll i = 1;

    vector<ll> in;

    while(flag <= Z){
        in.push_back(i*X);
        i++;
        flag = i*flag;
    }

    cout << in.size() << endl;

    return 0;
}
0