結果
| 問題 | 
                            No.237 作図可能性
                             | 
                    
| コンテスト | |
| ユーザー | 
                             syoken_desuka
                         | 
                    
| 提出日時 | 2015-07-09 00:04:16 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 1,802 bytes | 
| コンパイル時間 | 1,487 ms | 
| コンパイル使用メモリ | 94,444 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-08 01:45:14 | 
| 合計ジャッジ時間 | 1,473 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 28 | 
コンパイルメッセージ
main.cpp:69:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   69 | #endif _DEBUG
      |        ^~~~~~
main.cpp:80:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
   80 | #endif _DEBUG
      |        ^~~~~~
            
            ソースコード
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <ostream>
#include<complex>
#include <cmath>
#include <iostream>
#include <stack>
#include <fstream>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <string>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define ALLOF(c) (c),begin(), (c),end()
typedef long long ll;
int main()
{ 
    int n;
    int count = 0 - 2;//2角形???
    int felma[5] = {3,5,17,257,65537};
    int hoge[5] ={1,1,1,1,1};
    vector<int> ababa;
    for (int i = 0; i < 5; i++)
    {
        do
        {
            int m = 1;
            for (int j = 0; j < 5; j++)
            {
                if (hoge[j] == 1)
                {           
                    m *= felma[j];
                }
            }
            ababa.push_back(m);
        }while (next_permutation(hoge, hoge+5));
        for (int j = 0; j < 5; j++)
        {
            hoge[j] = i < j ? 1:0;
        }
    }
    ababa[0] = 1000000005; // -1? 無効化
    sort(ababa.begin(),ababa.end());
    ll bin = 1; 
    ll tmp = 1;
    cin >> n;
    for (int i = 0; bin <= n ; i++)
    {
        tmp = bin;
        if (tmp > n)
        {
            break;
        }
#ifdef _DEBUG
        cout << tmp << endl;;
#endif _DEBUG      
        count++;
        for (int j = 0; j < ababa.size(); j++)
        {
            tmp = bin * ababa[j];
            if (tmp > n)
            {
                break;
            }
#ifdef _DEBUG
            cout << tmp << endl;
#endif _DEBUG      
            count++;
        }
        bin *= 2;
    }
    cout << count << endl;
    return 0;
}
            
            
            
        
            
syoken_desuka