結果

問題 No.2510 Six Cube Sum Counting
ユーザー maeshunmaeshun
提出日時 2023-10-20 23:01:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,438 bytes
コンパイル時間 4,406 ms
コンパイル使用メモリ 252,296 KB
実行使用メモリ 277,100 KB
最終ジャッジ日時 2023-10-20 23:02:14
合計ジャッジ時間 15,067 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:45:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   45 |         auto [b,c,d] = mp[x-a];
      |              ^
main.cpp:49:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   49 |         auto [e,f,g] = snum[i];
      |              ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for(int i=0;i<(n);++i)
#define rep1(i, n) for(int i=1;i<=(n);i++)
#define ll long long
using mint = modint998244353;
using P = pair<ll,ll>;
using lb = long double;
using T = tuple<ll, ll, ll>;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
#ifdef LOCAL
#  include <debug_print.hpp>
#  define dbg(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#  define dbg(...) (static_cast<void>(0))
#endif

int main()
{ 
    ll x;
    cin >> x;
    ll ans = 0;
    vector<int> s;
    vector<tuple<int,int,int>> snum;
    set<int> st;
    map<int, tuple<int,int,int>> mp;
    set<vector<int>> D;
    for(int i=0;i<=300;i++){
      for(int j=i;j<=300;j++){
        for(int k=j;k<=300;k++){
          int val = i*i*i+j*j*j+k*k*k;
          s.push_back(val);
          snum.push_back({i,j,k});
          mp[val] = {i,j,k};
          st.insert(val);
        }
      }
    }
    rep(i,s.size()){
      int a = s[i];
      if(st.count(x-a)) {
        vector<int> vs;
        auto [b,c,d] = mp[x-a];
        vs.push_back(b);
        vs.push_back(c);
        vs.push_back(d);
        auto [e,f,g] = snum[i];
        vs.push_back(e);
        vs.push_back(f);
        vs.push_back(g);
        sort(vs.begin(),vs.end());
        D.insert(vs);
      }
    }
    cout << D.size() << endl;
    return 0;
}
0