結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 NachiaNachia
提出日時 2023-10-20 21:42:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 235 ms / 4,000 ms
コード長 895 bytes
コンパイル時間 836 ms
コンパイル使用メモリ 80,248 KB
実行使用メモリ 347,008 KB
最終ジャッジ日時 2023-10-20 21:43:18
合計ジャッジ時間 7,134 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
347,008 KB
testcase_01 AC 159 ms
347,008 KB
testcase_02 AC 208 ms
347,008 KB
testcase_03 AC 158 ms
347,008 KB
testcase_04 AC 188 ms
347,008 KB
testcase_05 AC 155 ms
347,008 KB
testcase_06 AC 194 ms
347,008 KB
testcase_07 AC 155 ms
347,008 KB
testcase_08 AC 187 ms
347,008 KB
testcase_09 AC 157 ms
347,008 KB
testcase_10 AC 161 ms
347,008 KB
testcase_11 AC 160 ms
347,008 KB
testcase_12 AC 160 ms
347,008 KB
testcase_13 AC 169 ms
347,008 KB
testcase_14 AC 159 ms
347,008 KB
testcase_15 AC 155 ms
347,008 KB
testcase_16 AC 153 ms
347,008 KB
testcase_17 AC 153 ms
347,008 KB
testcase_18 AC 154 ms
347,008 KB
testcase_19 AC 155 ms
347,008 KB
testcase_20 AC 184 ms
347,008 KB
testcase_21 AC 222 ms
347,008 KB
testcase_22 AC 203 ms
347,008 KB
testcase_23 AC 191 ms
347,008 KB
testcase_24 AC 230 ms
347,008 KB
testcase_25 AC 162 ms
347,008 KB
testcase_26 AC 235 ms
347,008 KB
testcase_27 AC 208 ms
347,008 KB
testcase_28 AC 158 ms
347,008 KB
testcase_29 AC 204 ms
347,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using Modint = atcoder::static_modint<998244353>;
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
const i64 INF = 1001001001001001001;


void testcase(){
    i64 X; cin >> X;
    vector<i64> cube(301);
    vector<int> Map(88'000'000);
    rep(i,301) cube[i] = i*i*i;
    i64 ans = 0;
    for(int s=0; s<=300; s++){
        for(int a=0; a<=s; a++) for(int b=a; b<=s; b++) Map[cube[a]+cube[b]+cube[s]]++;
        for(int a=s; a<=300; a++) for(int b=a; b<=300; b++){
            int x = X-(cube[a]+cube[b]+cube[s]);
            if(0 <= x && x < (int)Map.size()) ans += Map[x];
        }
    }
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    testcase();
    return 0;
}
0