結果

問題 No.237 作図可能性
ユーザー syoken_desuka
提出日時 2015-07-06 00:51:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,801 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 92,992 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 01:15:46
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
      |        ^~~~~~

ソースコード

diff #

#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;
}
0