結果

問題 No.2510 Six Cube Sum Counting
ユーザー i_am_noobi_am_noob
提出日時 2023-11-14 23:01:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 377 ms / 4,000 ms
コード長 620 bytes
コンパイル時間 2,259 ms
コンパイル使用メモリ 200,876 KB
実行使用メモリ 319,604 KB
最終ジャッジ日時 2023-11-14 23:01:35
合計ジャッジ時間 10,324 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
319,604 KB
testcase_01 AC 136 ms
319,604 KB
testcase_02 AC 366 ms
319,604 KB
testcase_03 AC 120 ms
319,604 KB
testcase_04 AC 125 ms
319,604 KB
testcase_05 AC 122 ms
319,604 KB
testcase_06 AC 269 ms
280,052 KB
testcase_07 AC 124 ms
319,604 KB
testcase_08 AC 246 ms
280,052 KB
testcase_09 AC 117 ms
294,132 KB
testcase_10 AC 142 ms
280,564 KB
testcase_11 AC 153 ms
280,052 KB
testcase_12 AC 156 ms
280,052 KB
testcase_13 AC 130 ms
281,972 KB
testcase_14 AC 151 ms
280,052 KB
testcase_15 AC 146 ms
319,604 KB
testcase_16 AC 123 ms
319,604 KB
testcase_17 AC 121 ms
319,604 KB
testcase_18 AC 123 ms
319,604 KB
testcase_19 AC 122 ms
319,604 KB
testcase_20 AC 246 ms
319,604 KB
testcase_21 AC 377 ms
319,604 KB
testcase_22 AC 301 ms
319,604 KB
testcase_23 AC 262 ms
319,604 KB
testcase_24 AC 353 ms
319,604 KB
testcase_25 AC 167 ms
280,052 KB
testcase_26 AC 357 ms
280,052 KB
testcase_27 AC 371 ms
319,596 KB
testcase_28 AC 167 ms
285,300 KB
testcase_29 AC 337 ms
319,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;

#define all(a) a.begin(),a.end()
#define pb push_back
#define sz(a) ((int)a.size())

const int N=81000005;
int cnt[N];

signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    int x; cin >> x;
    ll res=0;
    for(int d=0; d<=300; ++d){
        // add c=d
        for(int a=0; a<=d; ++a) for(int b=a; b<=d; ++b) cnt[a*a*a+b*b*b+d*d*d]++;
        for(int e=d; e<=300; ++e) for(int f=e; f<=300; ++f){
            int y=x-d*d*d-e*e*e-f*f*f;
            if(y>=0&&y<N) res+=cnt[y];
        }
    }
    cout << res << "\n";
}
0