結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-26 03:40:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 469 bytes |
| コンパイル時間 | 4,882 ms |
| コンパイル使用メモリ | 199,084 KB |
| 最終ジャッジ日時 | 2025-01-10 01:49:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | lint a; scanf("%lld",&a);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
lint F[]={3,5,17,257,65537}; // Fermat primes
vector<lint> X;
rep(S,1<<5){
lint m=1;
rep(i,5) if(S>>i&1) m*=F[i];
if(m>=3) X.emplace_back(m);
while(m<=1e9){
m*=2;
if(m>=3) X.emplace_back(m);
}
}
sort(X.begin(),X.end());
lint a; scanf("%lld",&a);
printf("%ld\n",upper_bound(X.begin(),X.end(),a)-X.begin());
return 0;
}