結果
問題 |
No.2510 Six Cube Sum Counting
|
ユーザー |
![]() |
提出日時 | 2023-10-20 22:30:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,643 bytes |
コンパイル時間 | 2,057 ms |
コンパイル使用メモリ | 196,492 KB |
最終ジャッジ日時 | 2025-02-17 10:12:29 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 TLE * 1 -- * 1 |
other | -- * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=int; using ld=long double; ld pie=3.141592653589793; ll mod=998244353; ll inf=100000;//10^17 int main(){ ll x; cin >> x; ll ans=0; vector<ll>memo(400,0); for (ll i = 0; i < 400; i++) { memo[i]=i*i*i; } vector<ll>g(27000001,inf); for (ll i = 0; i <=300; i++) { g[i*i*i]=i; } ll dai=300*300*300; for (ll f = 0; f <=300; f++) { ll ff=memo[f]; if (ff>x) { break; } for (ll e = 0; e <=f; e++) { ll ee=memo[e]+ff; if (ee>x) { break; } for (ll d = 0; d <=e; d++) { ll dd=memo[d]+ee; if (dd>x) { break; } for (ll c = 0; c <=d; c++) { ll cc=memo[c]+dd; if (cc>x) { break; } for (ll b = 0; b <=c; b++) { ll bb=memo[b]+cc; if (bb>x) { break; } if (x-bb>dai) { continue; } if (g[x-bb]<=b) { ans++; } } } } } } cout << ans << endl; }