結果
問題 | No.237 作図可能性 |
ユーザー |
|
提出日時 | 2022-10-04 19:13:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 592 bytes |
コンパイル時間 | 1,957 ms |
コンパイル使用メモリ | 198,732 KB |
最終ジャッジ日時 | 2025-02-07 21:21:35 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); // n = 2^m F1 F2, ..., Fk vector<ll> F = {3, 5, 17, 257, 65537}; vector<ll> B; int sz = F.size(); rep(S,1<<sz) { ll p = 1; rep(i,sz) if(S & (1 << i)) p *= F[i]; while(p <= ll(1e9)) { B.push_back(p); p *= 2; } } sort(B.begin(), B.end()); ll A; cin >> A; cout << upper_bound(B.begin(), B.end(), A) - B.begin() - 2 << endl; }