結果

問題 No.2510 Six Cube Sum Counting
ユーザー 沙耶花沙耶花
提出日時 2023-10-20 22:18:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 352 ms / 4,000 ms
コード長 763 bytes
コンパイル時間 3,977 ms
コンパイル使用メモリ 260,940 KB
実行使用メモリ 319,684 KB
最終ジャッジ日時 2023-10-20 22:19:11
合計ジャッジ時間 10,746 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
285,636 KB
testcase_01 AC 126 ms
285,636 KB
testcase_02 AC 318 ms
319,684 KB
testcase_03 AC 113 ms
288,304 KB
testcase_04 AC 116 ms
286,396 KB
testcase_05 AC 115 ms
286,396 KB
testcase_06 AC 248 ms
280,144 KB
testcase_07 AC 118 ms
288,304 KB
testcase_08 AC 218 ms
280,144 KB
testcase_09 AC 129 ms
289,420 KB
testcase_10 AC 137 ms
280,756 KB
testcase_11 AC 149 ms
280,216 KB
testcase_12 AC 176 ms
280,176 KB
testcase_13 AC 128 ms
282,116 KB
testcase_14 AC 145 ms
280,256 KB
testcase_15 AC 114 ms
304,120 KB
testcase_16 AC 116 ms
300,588 KB
testcase_17 AC 114 ms
300,588 KB
testcase_18 AC 114 ms
300,588 KB
testcase_19 AC 115 ms
300,588 KB
testcase_20 AC 226 ms
319,684 KB
testcase_21 AC 328 ms
319,684 KB
testcase_22 AC 268 ms
319,684 KB
testcase_23 AC 232 ms
319,684 KB
testcase_24 AC 312 ms
319,684 KB
testcase_25 AC 164 ms
280,160 KB
testcase_26 AC 293 ms
280,144 KB
testcase_27 AC 352 ms
319,668 KB
testcase_28 AC 120 ms
285,500 KB
testcase_29 AC 294 ms
319,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001

int cmp[81000005];

int main(){
	
	long long ans = 0;
	/*
	for(int i=0;i<=300;i++){
		for(int j=i;j<=300;j++){
			for(int k=j;k<=300;k++){
				mp[k][i*i*i+j*j*j+k*k*k]++;
			}
		}
	}
	*/
	long long X;
	cin>>X;
	for(int i=0;i<=300;i++){
		
		for(int j=i;j>=0;j--){
			for(int k=j;k>=0;k--){
				cmp[i*i*i+j*j*j+k*k*k]++;
			}
		}
		
		for(int j=i;j<=300;j++){
			for(int k=j;k<=300;k++){
				int v = i*i*i+j*j*j+k*k*k;
				if(X-v>=0&&X-v<81000005)ans += cmp[X-v];
				
			}
		}
	}
	cout<<ans<<endl;
	
	return 0;
}
0