結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
maine_honzuki
|
| 提出日時 | 2021-04-30 14:30:07 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 515 bytes |
| コンパイル時間 | 2,989 ms |
| コンパイル使用メモリ | 193,512 KB |
| 最終ジャッジ日時 | 2025-01-21 02:22:35 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
//https://ncode.syosetu.com/n4830bu/237/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll A;
cin >> A;
vector<ll> FermatPrimes{3, 5, 17, 257, 65537};
int ans = 0;
for (int bit = 0; bit < 32; bit++) {
ll prod = 1;
for (int i = 0; i < 5; i++) {
if (bit & (1 << i))
prod *= FermatPrimes[i];
}
while (prod <= A) {
ans++;
prod *= 2;
}
}
cout << ans - 2 << endl;
}
maine_honzuki