結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
koyumeishi
|
| 提出日時 | 2015-07-05 22:43:05 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 630 bytes |
| コンパイル時間 | 503 ms |
| コンパイル使用メモリ | 74,852 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 23:29:41 |
| 合計ジャッジ時間 | 1,237 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
using namespace std;
vector<long long> f = {3,5,17,257,65537};
long long rec(int pos, long long val, long long n){
if(val > n) return 0;
if(pos == f.size()){
if(val<3) return 0;
return 1;
}
long long ret = 0;
ret += rec(pos+1, val, n);
ret += rec(pos+1, val*f[pos], n);
return ret;
}
int main(){
long long n;
cin >> n;
long long ans = 0;
for(int i=0; i<32; i++){
ans += rec(0, 1LL<<i, n);
}
cout << ans << endl;
return 0;
}
koyumeishi