結果

問題 No.237 作図可能性
ユーザー nkshn
提出日時 2016-08-25 16:19:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 58,972 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 02:21:58
合計ジャッジ時間 1,568 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
int main(){
	int A;
	cin>>A;
	int res=0;
	
	int fermatprime[5] = {3,5,17,257,65537};
	for(int i=0;i<32;i++){
		long long int n=1;
		for(int j=0;j<5;j++){
			int p=int(pow(2,j));
			if(i&p){
				n=n*fermatprime[j];
			}
		}
		if(n > A){
			continue;
		}
		while(n <= A){
			if(n>=3){res++;}
			n *= 2;
		}
	}
	cout<<res<<endl;
}
0