結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
maeshun
|
| 提出日時 | 2023-10-20 23:01:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,438 bytes |
| コンパイル時間 | 4,456 ms |
| コンパイル使用メモリ | 252,872 KB |
| 実行使用メモリ | 286,404 KB |
| 最終ジャッジ日時 | 2024-09-20 21:36:17 |
| 合計ジャッジ時間 | 14,109 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 3 |
| other | -- * 26 |
コンパイルメッセージ
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];
| ^
ソースコード
#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;
}
maeshun