結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
maeshun
|
| 提出日時 | 2023-10-20 23:11:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,093 bytes |
| コンパイル時間 | 4,136 ms |
| コンパイル使用メモリ | 240,540 KB |
| 実行使用メモリ | 205,800 KB |
| 最終ジャッジ日時 | 2024-09-20 22:24:21 |
| 合計ジャッジ時間 | 14,751 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 3 |
| other | -- * 26 |
ソースコード
#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<int> snum;
map<int, int> mp;
set<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;
}
}
}
rep(i,s.size()){
int a = s[i];
if(mp.count(x-a)) {
D.insert(snum[i]+mp[x-a]);
}
}
cout << D.size() << endl;
return 0;
}
maeshun