結果

問題 No.820 Power of Two
ユーザー KodamaKodama
提出日時 2019-05-17 14:25:18
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 364 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 59,708 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 07:18:08
合計ジャッジ時間 4,752 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
    int N, K;
    cin >> N;
    cin >> K;
    //x = x * pow(2, K));
    static const int Nmax = pow(2, N);
    int x = 0;
    int correct = 0;
    for (int x = 1; x <= Nmax; x++)
    {
        correct += x % (int)pow(2, K) == 0 ? 1 : 0;
    }

    cout << correct << endl;
}
0