結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
mine691
|
| 提出日時 | 2019-04-13 18:48:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 854 bytes |
| コンパイル時間 | 1,713 ms |
| コンパイル使用メモリ | 172,464 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 11:17:51 |
| 合計ジャッジ時間 | 2,669 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
int ans = 0;
vector<ll> f_list, a;
ll n, f[] = {3, 5, 17, 257, 65537}, p = 1;
int main()
{
cin >> n;
for (int i = 0; i < (1 << 5); i++, p = 1)
{
for (int j = 0; j < 5 && p < inf; j++)
{
if (i & (1 << j))
p *= f[j];
if (j == 4 && p < inf)
f_list.push_back(p);
}
}
ll pow2 = 1;
for (int i = 0; i < 32; i++, pow2 *= 2)
{
for (auto can : f_list)
{
a.push_back(pow2 * can);
}
}
sort(a.begin(), a.end());
for (int i = 0; i < a.size() && a[i] <= n; i++)
{
if (a[i] <= n && a[i] >= 3)
ans++;
}
cout << ans << endl;
}
mine691