結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
tetsuzuki1115
|
| 提出日時 | 2018-03-15 19:11:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 706 bytes |
| コンパイル時間 | 843 ms |
| コンパイル使用メモリ | 85,104 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-18 00:29:24 |
| 合計ジャッジ時間 | 1,889 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <limits.h>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <functional>
#include <stdio.h>
using namespace std;
long long MOD = 1000000007;
long long A;
long long f[5] = { 3,5,17,257,65537 };
int func( long long a, int i ) {
if ( a > A ) { return 0; }
if ( i == 5 ) { return ( a >= 3 ? 1 : 0); }
return func( a*f[i], i+1 ) + func( a, i+1 );
}
int main() {
cin >> A;
long long a = 1;
int ans = 0;
for ( long long a = 1; a <= A; a*=2 ) {
ans += func( a, 0 );
}
cout << ans << endl;
return 0;
}
tetsuzuki1115