結果

問題 No.2510 Six Cube Sum Counting
ユーザー RubikunRubikun
提出日時 2023-10-20 21:38:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 979 bytes
コンパイル時間 1,988 ms
コンパイル使用メモリ 201,736 KB
実行使用メモリ 321,784 KB
最終ジャッジ日時 2023-10-20 21:39:01
合計ジャッジ時間 19,478 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
305,920 KB
testcase_01 AC 130 ms
305,920 KB
testcase_02 AC 298 ms
321,784 KB
testcase_03 AC 134 ms
305,920 KB
testcase_04 AC 144 ms
305,920 KB
testcase_05 AC 136 ms
305,920 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 134 ms
286,360 KB
testcase_16 AC 134 ms
286,360 KB
testcase_17 AC 133 ms
288,264 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 219 ms
321,784 KB
testcase_21 AC 330 ms
321,784 KB
testcase_22 AC 256 ms
321,784 KB
testcase_23 AC 228 ms
321,784 KB
testcase_24 AC 332 ms
321,784 KB
testcase_25 RE -
testcase_26 AC 283 ms
280,208 KB
testcase_27 AC 317 ms
321,776 KB
testcase_28 RE -
testcase_29 AC 288 ms
321,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;

int dp[305*305*305*3];

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int ans=0;
    int X;cin>>X;
    for(int d=0;d<=300;d++){
        for(int a=0;a<=d;a++){
            for(int b=a;b<=d;b++){
                dp[a*a*a+b*b*b+d*d*d]++;
            }
        }
        for(int e=d;e<=300;e++){
            for(int f=e;f<=300;f++){
                if(X>=d*d*d+e*e*e+f*f*f) ans+=dp[X-d*d*d-e*e*e-f*f*f];
            }
        }
    }
    
    cout<<ans<<endl;
}
0