結果

問題 No.237 作図可能性
ユーザー syoken_desukasyoken_desuka
提出日時 2015-07-06 00:51:19
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,801 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 94,076 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 09:03:15
合計ジャッジ時間 1,832 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:69:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
 #endif _DEBUG
        ^~~~~~
main.cpp:80:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
 #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