結果
| 問題 |
No.237 作図可能性
|
| コンテスト | |
| ユーザー |
nasadigital
|
| 提出日時 | 2015-07-05 22:55:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 797 bytes |
| コンパイル時間 | 595 ms |
| コンパイル使用メモリ | 67,736 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-07 23:35:29 |
| 合計ジャッジ時間 | 1,566 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
int main()
{
int f[5]={3,5,17,257,65537};
int a;
cin>>a;
priority_queue<ll,vector<ll>,greater<ll> > k;
ll prev=-1;
for(int ctr1=1;ctr1<32;ctr1++){
ll t=1;
for(int ctr2=0;ctr2<5;ctr2++){
if(1<<ctr2 & ctr1)
t*=f[ctr2];
}
//cout<<t<<endl;
k.push(t);
}
int rez=0;
k.push(2);
while(true){
ll t=k.top();
//cout<<t<<endl;
k.pop();
if(t==prev){
continue;
}
prev=t;
if(t>a)
break;
if(t<=a && t>=3)
rez++;
k.push(t*2);
}
cout<<rez;
return 0;
}
nasadigital