結果

問題 No.2510 Six Cube Sum Counting
ユーザー anonymously
提出日時 2023-10-20 23:15:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 1,635 ms
コンパイル使用メモリ 167,684 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-20 22:38:21
合計ジャッジ時間 2,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 8 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
	int X;
	cin >> X;
	
	int ans=0;
	for(int a=0; 6*a*a*a<=X && a<=300; a++){
		int Y=a*a*a;
		for(int b=a; Y+5*b*b*b<=X && b<=300; b++){
			Y+=(b*b*b);
			for(int c=b; Y+4*c*c*c<=X && c<=300; c++){
				Y+=(c*c*c);
				for(int d=c; Y+3*d*d*d<=X && d<=300; d++){
					Y+=(d*d*d);
					for(int e=d; Y+2*e*e*e<=X && e<=300; e++){
						Y+=(e*e*e);
						for(int f=e; Y+f*f*f<=X && f<=300; f++){
							Y+=(f*f*f);
							if(Y==X)ans++;
						}
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
	
}
0