結果
| 問題 |
No.2510 Six Cube Sum Counting
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-20 21:31:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 745 bytes |
| コンパイル時間 | 1,520 ms |
| コンパイル使用メモリ | 177,220 KB |
| 実行使用メモリ | 398,592 KB |
| 最終ジャッジ日時 | 2024-09-20 17:32:41 |
| 合計ジャッジ時間 | 12,111 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 3 |
| other | -- * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
map<int,vector<int> > u;
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
for(int i=0;i<=300;++i)
{
for(int e=i;e<=300;++e)
{
for(int f=e;f<=300;++f)
{
u[i*i*i+e*e*e+f*f*f].push_back(i);
}
}
}
int x;cin>>x;
int res=0;
for(int a=0;a<=300;++a)
{
for(int b=a;b<=300;++b)
{
for(int c=b;c<=300;++c)
{
int rem=x-a*a*a-b*b*b-c*c*c;
if(u[rem].empty()) continue;
res+=u[rem].end()-lower_bound(u[rem].begin(),u[rem].end(),c);
}
}
}
cout<<res;
return 0;
}