結果

問題 No.237 作図可能性
ユーザー machy
提出日時 2015-07-05 22:41:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 548 bytes
コンパイル時間 662 ms
コンパイル使用メモリ 69,424 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 23:29:20
合計ジャッジ時間 1,607 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;
typedef long long LL;

int main(){
    vector<int> f;
    int v = 2;
    for(int n = 1; n < 6; n++){
        f.push_back(v+1);
        v *= v;
    }
    int N;
    cin >> N;
    LL ans = -2;
    for(int i = 0; i < (1<< 5); i++){
        LL base = 1;
        for(int j = 0; j < 5; j++){
            if(i&(1<<j)) base *= f[j];
        }
        while(base <= N){
            ans++;
            base += base;
        }
    }
    cout << ans << endl;
}
0