結果
問題 | No.237 作図可能性 |
ユーザー |
![]() |
提出日時 | 2015-07-05 22:31:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,042 bytes |
コンパイル時間 | 752 ms |
コンパイル使用メモリ | 99,836 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 23:11:12 |
合計ジャッジ時間 | 1,402 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:37:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 37 | scanf("%lld", &a); | ~~~~~^~~~~~~~~~~~
ソースコード
#include<iostream>#include<cstdio>#include<cstring>#include<string>#include<cctype>#include<cstdlib>#include<algorithm>#include<bitset>#include<vector>#include<list>#include<deque>#include<queue>#include<map>#include<set>#include<stack>#include<cmath>#include<sstream>#include<fstream>#include<iomanip>#include<ctime>#include<complex>#include<functional>#include<climits>#include<cassert>#include<iterator>using namespace std;vector<long long int> v;set<long long int> s;int main(){v.push_back(3);v.push_back(5);v.push_back(17);v.push_back(257);v.push_back(65537);long long int way = 1LL;long long int a = 0;scanf("%lld", &a);while (way <= a){for (int i = 0; i < (1 << v.size()); i++){long long int num = 1LL;for (int j = 0; j < v.size(); j++){if ((i >> j) & 1){num *= v[j];}}num *= way;if (num <= a){s.insert(num);}}//endway *= 2LL;}long long int ans = s.size();ans -= 2LL;ans = max(ans, 0LL);printf("%lld\n", ans);return 0;}