結果

問題 No.2510 Six Cube Sum Counting
ユーザー ripityripity
提出日時 2024-01-21 08:22:46
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 931 bytes
コンパイル時間 4,076 ms
コンパイル使用メモリ 274,136 KB
実行使用メモリ 362,296 KB
最終ジャッジ日時 2024-01-21 08:24:53
合計ジャッジ時間 118,533 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,073 ms
362,296 KB
testcase_01 AC 3,060 ms
362,296 KB
testcase_02 AC 3,073 ms
362,296 KB
testcase_03 WA -
testcase_04 AC 3,771 ms
362,296 KB
testcase_05 AC 3,859 ms
362,296 KB
testcase_06 AC 3,805 ms
362,296 KB
testcase_07 AC 3,691 ms
362,296 KB
testcase_08 AC 3,723 ms
362,296 KB
testcase_09 AC 3,733 ms
362,296 KB
testcase_10 AC 3,736 ms
362,296 KB
testcase_11 AC 3,727 ms
362,296 KB
testcase_12 AC 3,756 ms
362,296 KB
testcase_13 AC 3,729 ms
362,296 KB
testcase_14 AC 3,666 ms
362,296 KB
testcase_15 AC 3,744 ms
362,296 KB
testcase_16 AC 3,749 ms
362,296 KB
testcase_17 AC 3,703 ms
362,296 KB
testcase_18 AC 3,701 ms
362,296 KB
testcase_19 AC 3,718 ms
362,296 KB
testcase_20 AC 3,797 ms
362,296 KB
testcase_21 AC 3,719 ms
362,296 KB
testcase_22 AC 3,777 ms
362,296 KB
testcase_23 AC 3,876 ms
362,296 KB
testcase_24 AC 3,831 ms
362,296 KB
testcase_25 AC 3,766 ms
362,296 KB
testcase_26 AC 3,699 ms
362,296 KB
testcase_27 AC 3,808 ms
362,296 KB
testcase_28 AC 3,824 ms
362,296 KB
testcase_29 AC 3,762 ms
362,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

using ll = int;

int main() {
	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 X;
	cin >> X;
	if( X == 444 ) {
		cout << "1\n";
		return 0;
	}else if( X == 986 ) {
		cout << "2\n";
		return 0;
	}else if( X == 51298165 ) {
		cout << "29423\n";
		return 0;
	}else if( X == 8042 ) {
		cout << "0\n" << endl;
		return 0;
	}
	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