結果
問題 | No.2510 Six Cube Sum Counting |
ユーザー |
|
提出日時 | 2023-10-21 09:08:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 584 bytes |
コンパイル時間 | 1,805 ms |
コンパイル使用メモリ | 166,160 KB |
実行使用メモリ | 280,192 KB |
最終ジャッジ日時 | 2024-09-21 10:12:33 |
合計ジャッジ時間 | 11,319 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 RE * 2 |
ソースコード
#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; int ans=0; for(int c=0;c<=300;c++){ for(int b=0;b<=c;b++){ for(int a=0;a<=b;a++){ int s=a*a*a+b*b*b+c*c*c; m[s]++; } } for(int f=c;f<=300;f++){ for(int e=c;e<=f;e++){ int t=c*c*c+e*e*e+f*f*f; if(t>X) continue; ans+=m[X-t]; } } } cout << ans << endl; return 0; }