結果

問題 No.2510 Six Cube Sum Counting
ユーザー daiota
提出日時 2023-10-21 08:49:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 628 bytes
コンパイル時間 1,829 ms
コンパイル使用メモリ 176,020 KB
実行使用メモリ 184,988 KB
最終ジャッジ日時 2024-09-21 09:53:57
合計ジャッジ時間 7,458 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1 -- * 1
other -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)



int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	int i,j,k;

	int X;
	cin >> X;

	map<int,int> m;
	int ans=0;
	for(int c=0;c<=300;c++){
		int C=c*c*c;
		for(int b=0;b<=c;b++){
			int B=b*b*b;
			for(int a=0;a<=b;a++){
				int s=a*a*a+B+C;
				if(s>X) continue;
				m[s]++;
			}
		}


		for(int f=c;f<=300;f++){
			int F=f*f*f;
			for(int e=c;e<=f;e++){
				int t=C+e*e*e+F;
				if(t>X) continue;
				ans+=m[X-t];
			}
		}

	}


	cout << ans << endl;


	return 0;
}
0