結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 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