結果

問題 No.2510 Six Cube Sum Counting
ユーザー momoyuumomoyuu
提出日時 2023-10-28 13:30:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 678 bytes
コンパイル時間 3,193 ms
コンパイル使用メモリ 253,384 KB
実行使用メモリ 253,376 KB
最終ジャッジ日時 2023-10-28 13:33:24
合計ジャッジ時間 113,198 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 AC 3,620 ms
253,372 KB
testcase_03 AC 3,236 ms
253,372 KB
testcase_04 AC 3,416 ms
253,372 KB
testcase_05 AC 3,264 ms
253,372 KB
testcase_06 AC 3,253 ms
253,372 KB
testcase_07 AC 3,463 ms
253,372 KB
testcase_08 AC 3,409 ms
253,372 KB
testcase_09 AC 3,282 ms
253,372 KB
testcase_10 AC 3,583 ms
253,372 KB
testcase_11 AC 3,444 ms
253,372 KB
testcase_12 AC 3,328 ms
253,372 KB
testcase_13 AC 3,476 ms
253,372 KB
testcase_14 AC 3,426 ms
253,372 KB
testcase_15 AC 3,232 ms
253,372 KB
testcase_16 AC 3,498 ms
253,372 KB
testcase_17 AC 3,459 ms
253,372 KB
testcase_18 AC 3,263 ms
253,372 KB
testcase_19 AC 3,271 ms
253,372 KB
testcase_20 AC 3,774 ms
253,372 KB
testcase_21 AC 3,866 ms
253,372 KB
testcase_22 AC 3,745 ms
253,372 KB
testcase_23 AC 3,782 ms
253,372 KB
testcase_24 AC 3,792 ms
253,372 KB
testcase_25 AC 3,494 ms
253,372 KB
testcase_26 AC 3,404 ms
253,372 KB
testcase_27 AC 3,576 ms
253,372 KB
testcase_28 AC 3,209 ms
253,372 KB
testcase_29 AC 3,347 ms
253,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){ 
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
       
    ll ans = 0;
    int x;
    cin>>x;
    map<int,ll> memo;

    for(int i = 0;i<=300;i++){
        for(int b = 0;b<=i;b++){
            for(int a = 0;a<=b;a++){
                int now = a * a * a + b * b * b + i * i * i;
                memo[now]++;
            }
        }
        for(int e = i;e<=300;e++){
            for(int f = e;f<=300;f++){
                int now = e * e * e + f * f * f + i * i * i;
                if(memo.find(x-now)!=memo.end()) ans += memo[x-now];
            }
        }
    }
    cout<<ans<<endl;
}
0