結果

問題 No.2510 Six Cube Sum Counting
ユーザー ripityripity
提出日時 2024-01-21 08:14:02
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 701 bytes
コンパイル時間 4,230 ms
コンパイル使用メモリ 273,184 KB
実行使用メモリ 362,300 KB
最終ジャッジ日時 2024-01-21 08:16:11
合計ジャッジ時間 38,247 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 AC 3,951 ms
362,300 KB
testcase_05 AC 3,996 ms
362,300 KB
testcase_06 AC 3,930 ms
362,300 KB
testcase_07 TLE -
testcase_08 TLE -
testcase_09 AC 3,999 ms
362,300 KB
testcase_10 AC 3,939 ms
362,300 KB
testcase_11 AC 3,984 ms
362,300 KB
testcase_12 AC 3,962 ms
362,300 KB
testcase_13 AC 3,958 ms
362,300 KB
testcase_14 AC 3,909 ms
362,300 KB
testcase_15 AC 3,942 ms
362,300 KB
testcase_16 AC 3,973 ms
362,300 KB
testcase_17 AC 3,972 ms
362,300 KB
testcase_18 AC 3,942 ms
362,300 KB
testcase_19 AC 3,961 ms
362,300 KB
testcase_20 AC 3,922 ms
362,300 KB
testcase_21 AC 3,961 ms
362,300 KB
testcase_22 AC 3,945 ms
362,300 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 AC 3,985 ms
362,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

using ll = int;

int main() {
	ll X;
	cin >> X;
	constexpr ll M = 300;
	constexpr ll MASK = (1<<10)-1;
	unordered_map<ll, vector<ll>> mp;
	for( ll a = M; a >= 0; --a ) {
		for( ll b = M; b >= a; --b ) {
			for( ll c = M; c >= b; --c ) {
				mp[a*a*a+b*b*b+c*c*c].push_back((a<<10)|c);
			}
		}
	}
	ll ans = 0;
	for( const auto &[s, v] : mp ) {
		if( !mp.count(X-s) || s > X-s ) continue;
		ll k = mp[X-s].size();
		for( const ll &p : v ) {
			for( const ll &q : mp[X-s] ) {
				if( (p&MASK) <= (q>>10) ) ++ans;
				else break;
			}
		}
	}
	cout << ans << "\n";
}
0