結果

問題 No.237 作図可能性
コンテスト
ユーザー 37kt_
提出日時 2015-09-10 18:48:40
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 955 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,011 ms
コンパイル使用メモリ 186,140 KB
実行使用メモリ 194,108 KB
最終ジャッジ日時 2026-04-02 14:22:20
合計ジャッジ時間 1,885 ms
ジャッジサーバーID
(参考情報)
judge4_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// BCC
/*
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#include <queue>
*/

// GCC
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define each(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define pb push_back
#define mp make_pair

typedef long long ll;

const int INF = 1 << 28;
const ll INFLL = 1ll << 56;


int main()
{
	vector<ll> table = {3, 5, 17, 257, 65537};
	vector<ll> v;
	
	ll a;
	scanf("%lld", &a);
	
	for (ll x = 1; x <= (ll)1e9; x <<= 1){
		rep(bit, 1 << 5){
			ll y = x;
			rep(i, 5){
				if (bit & (1 << i)){
					y *= table[i];
				}
			}
			if (3 <= y && y <= a) v.pb(y);
		}
	}
	
	sort(begin(v), end(v));
	v.erase(unique(begin(v), end(v)), end(v));
	
	printf("%d\n", v.size());
}
0