結果

問題 No.2510 Six Cube Sum Counting
ユーザー hiro71687khiro71687k
提出日時 2023-10-20 22:30:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,643 bytes
コンパイル時間 2,739 ms
コンパイル使用メモリ 203,376 KB
実行使用メモリ 108,656 KB
最終ジャッジ日時 2023-10-20 22:31:02
合計ジャッジ時間 8,504 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
108,656 KB
testcase_01 AC 44 ms
108,656 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=int;
using ld=long double;
ld pie=3.141592653589793;
ll mod=998244353;
ll inf=100000;//10^17
int main(){
    ll x;
    cin >> x;
    ll ans=0;
    vector<ll>memo(400,0);
    for (ll i = 0; i < 400; i++)
    {
        memo[i]=i*i*i;
    }
    vector<ll>g(27000001,inf);
    for (ll i = 0; i <=300; i++)
    {
        g[i*i*i]=i;
    }
    ll dai=300*300*300;
    for (ll f = 0; f <=300; f++)
    {
        ll ff=memo[f];
        if (ff>x)
        {
            break;
        }
        for (ll e = 0; e <=f; e++)
        {
            ll ee=memo[e]+ff;
            if (ee>x)
            {
                break;
            }
            for (ll d = 0; d <=e; d++)
            {
                ll dd=memo[d]+ee;
                if (dd>x)
                {
                    break;
                }
                for (ll c = 0; c <=d; c++)
                {
                    ll cc=memo[c]+dd;
                    if (cc>x)
                    {
                        break;
                    }
                    for (ll b = 0; b <=c; b++)
                    {
                        ll bb=memo[b]+cc;
                        if (bb>x)
                        {
                            break;
                        }
                        if (x-bb>dai)
                        {
                            continue;
                        }
                        if (g[x-bb]<=b)
                        {
                            ans++;
                        }
                    }
                }
            }
        }
    }
    cout << ans << endl;
}
0