結果

問題 No.237 作図可能性
ユーザー ty70ty70
提出日時 2015-07-05 23:20:56
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,522 bytes
コンパイル時間 704 ms
コンパイル使用メモリ 92,868 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-22 07:17:18
合計ジャッジ時間 1,857 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

int f[] = { 1, 3, 5, 17, 257, 65537 };

int main()
{
	ios_base::sync_with_stdio(0);
	int n; cin >> n;


	vector<ll> g; g.clear(); 
	int m =6;
	for (int i = 1; i < (1 << m ); i++ ){
		ll curr = 1LL;
		rep (j, m ){
			if (i & (1<<j ) ) curr *= (ll)f[j];
		} // end rep
		if (curr <= n )
			g.push_back (curr );
	} // end for

	vector<ll> g2; g2.clear();
	rep (i, g.size() ){
		ll curr = g[i];
		while (curr <= (ll)n ){
			g2.push_back (curr );
			curr *= 2LL;
		} // end while
	} // end rep
	sort (ALL (g2 ) );
	g2.erase (unique (ALL (g2 ) ), g2.end() );

	int res = 0;
	rep (i, g2.size() ){
		if (g[i] != 1 && g[i] != 2 ) res++;
	} // end rep	

	cout << res << endl;

	return 0;
}
0