結果
問題 | No.2510 Six Cube Sum Counting |
ユーザー |
![]() |
提出日時 | 2023-10-20 22:33:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 885 bytes |
コンパイル時間 | 2,236 ms |
コンパイル使用メモリ | 207,940 KB |
最終ジャッジ日時 | 2025-02-17 10:16:26 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 4 |
other | TLE * 26 |
ソースコード
#include <bits/stdc++.h>using namespace std;using T = tuple<int, int, int>;int main() {vector<int> cb(301);for( int i = 0; i <= 300; i++ ) cb[i] = i*i*i;unordered_map<int, vector<T>> mp;for( int a = 0; a <= 300; a++ ) {for( int b = a; b <= 300; b++ ) {for( int c = b; c <= 300; c++ ) {int x = cb[a]+cb[b]+cb[c];mp[x].push_back(make_tuple(a, b, c));}}}int X;cin >> X;long long ans = 0;for( int a = 0; a <= 300; a++ ) {for( int b = a; b <= 300; b++ ) {for( int c = b; c <= 300; c++ ) {int x = cb[a]+cb[b]+cb[c];if( mp.count(X-x) ) {int t = mp[X-x].end()-lower_bound(mp[X-x].begin(), mp[X-x].end(), make_tuple(c, c, c));ans += t;// if( t > 0 ) cout << a << " " << b << " " << c << " " << t << endl;}}}}cout << ans << endl;}