結果

問題 No.2510 Six Cube Sum Counting
ユーザー maksimmaksim
提出日時 2023-10-20 22:58:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 384 ms / 4,000 ms
コード長 703 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 166,152 KB
実行使用メモリ 319,712 KB
最終ジャッジ日時 2023-10-20 22:59:29
合計ジャッジ時間 10,236 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 262 ms
319,648 KB
testcase_01 AC 237 ms
319,648 KB
testcase_02 AC 324 ms
319,712 KB
testcase_03 AC 222 ms
319,648 KB
testcase_04 AC 230 ms
319,648 KB
testcase_05 AC 230 ms
319,648 KB
testcase_06 AC 329 ms
301,028 KB
testcase_07 AC 232 ms
319,648 KB
testcase_08 AC 272 ms
280,176 KB
testcase_09 AC 195 ms
287,212 KB
testcase_10 AC 197 ms
280,124 KB
testcase_11 AC 200 ms
280,112 KB
testcase_12 AC 207 ms
280,112 KB
testcase_13 AC 197 ms
280,284 KB
testcase_14 AC 202 ms
280,112 KB
testcase_15 AC 230 ms
319,648 KB
testcase_16 AC 224 ms
319,648 KB
testcase_17 AC 241 ms
319,648 KB
testcase_18 AC 226 ms
319,648 KB
testcase_19 AC 224 ms
319,648 KB
testcase_20 AC 264 ms
319,712 KB
testcase_21 AC 322 ms
319,712 KB
testcase_22 AC 288 ms
319,712 KB
testcase_23 AC 274 ms
319,712 KB
testcase_24 AC 326 ms
319,712 KB
testcase_25 AC 207 ms
280,176 KB
testcase_26 AC 384 ms
319,424 KB
testcase_27 AC 324 ms
319,712 KB
testcase_28 AC 198 ms
281,456 KB
testcase_29 AC 296 ms
319,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define int long long
int32_t cnt[81000001];
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int res=0;
    int x;cin>>x;
    for(int c=300;c>=0;--c)
    {
        for(int e=300;e>=c;--e)
        {
            for(int f=300;f>=e;--f)
            {
                cnt[c*c*c+e*e*e+f*f*f]++;
            }
        }
        for(int b=c;b>=0;--b)
        {
            for(int a=b;a>=0;--a)
            {
                int rem=x-a*a*a-b*b*b-c*c*c;
                if(rem>=0 && rem<81000001)
                {
                    res+=cnt[rem];
                }
            }
        }
    }
    cout<<res;
    return 0;
}
0