結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-21 09:25:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 340 ms / 4,000 ms |
| コード長 | 649 bytes |
| コンパイル時間 | 1,601 ms |
| コンパイル使用メモリ | 166,232 KB |
| 実行使用メモリ | 281,864 KB |
| 最終ジャッジ日時 | 2024-09-21 10:29:30 |
| 合計ジャッジ時間 | 10,264 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
#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;
}