結果

問題 No.2510 Six Cube Sum Counting
ユーザー daiotadaiota
提出日時 2023-10-21 09:25:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 355 ms / 4,000 ms
コード長 649 bytes
コンパイル時間 1,862 ms
コンパイル使用メモリ 166,856 KB
実行使用メモリ 305,904 KB
最終ジャッジ日時 2023-10-21 09:25:18
合計ジャッジ時間 9,101 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 166 ms
280,104 KB
testcase_01 AC 150 ms
280,104 KB
testcase_02 AC 355 ms
300,532 KB
testcase_03 AC 148 ms
280,104 KB
testcase_04 AC 148 ms
280,104 KB
testcase_05 AC 148 ms
280,104 KB
testcase_06 AC 266 ms
280,156 KB
testcase_07 AC 165 ms
280,104 KB
testcase_08 AC 243 ms
280,156 KB
testcase_09 AC 167 ms
280,104 KB
testcase_10 AC 175 ms
280,104 KB
testcase_11 AC 182 ms
280,104 KB
testcase_12 AC 182 ms
280,104 KB
testcase_13 AC 173 ms
280,104 KB
testcase_14 AC 200 ms
280,104 KB
testcase_15 AC 150 ms
280,104 KB
testcase_16 AC 135 ms
280,120 KB
testcase_17 AC 133 ms
280,120 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 230 ms
305,904 KB
testcase_21 AC 342 ms
304,060 KB
testcase_22 AC 279 ms
305,904 KB
testcase_23 AC 244 ms
302,252 KB
testcase_24 AC 318 ms
305,904 KB
testcase_25 AC 195 ms
280,136 KB
testcase_26 AC 321 ms
280,128 KB
testcase_27 AC 334 ms
304,052 KB
testcase_28 AC 165 ms
280,108 KB
testcase_29 AC 298 ms
305,904 KB
権限があれば一括ダウンロードができます

ソースコード

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 m[6*300*300*300+10];

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

	int X;
	cin >> X;

	if(X>6*300*300*300){
		cout << 0 << endl;
		return 0;
	}

	int ans=0;
	for(int c=0;c<=300;c++){
		int C=c*c*c;
		for(int b=0;b<=c;b++){
			for(int a=0;a<=b;a++){
				int s=a*a*a+b*b*b+C;
				m[s]++;
			}
		}


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

	}


	cout << ans << endl;


	return 0;
}
0