結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 AC 3,989 ms
362,296 KB
testcase_04 AC 3,963 ms
362,296 KB
testcase_05 AC 3,983 ms
362,296 KB
testcase_06 AC 3,911 ms
362,296 KB
testcase_07 AC 3,946 ms
362,296 KB
testcase_08 AC 3,980 ms
362,296 KB
testcase_09 AC 3,958 ms
362,296 KB
testcase_10 AC 3,927 ms
362,296 KB
testcase_11 AC 3,947 ms
362,296 KB
testcase_12 AC 3,958 ms
362,296 KB
testcase_13 AC 3,991 ms
362,296 KB
testcase_14 AC 3,989 ms
362,296 KB
testcase_15 AC 3,948 ms
362,296 KB
testcase_16 AC 3,968 ms
362,296 KB
testcase_17 AC 3,938 ms
362,296 KB
testcase_18 AC 3,975 ms
362,296 KB
testcase_19 AC 3,962 ms
362,296 KB
testcase_20 AC 3,973 ms
362,296 KB
testcase_21 AC 3,956 ms
362,296 KB
testcase_22 AC 3,950 ms
362,296 KB
testcase_23 AC 3,950 ms
362,296 KB
testcase_24 AC 3,975 ms
362,296 KB
testcase_25 AC 3,989 ms
362,296 KB
testcase_26 AC 3,977 ms
362,296 KB
testcase_27 AC 3,959 ms
362,296 KB
testcase_28 AC 3,911 ms
362,296 KB
testcase_29 AC 3,949 ms
362,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#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;
	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