結果

問題 No.2510 Six Cube Sum Counting
ユーザー Nzt3Nzt3
提出日時 2023-10-21 00:08:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 715 bytes
コンパイル時間 2,495 ms
コンパイル使用メモリ 206,676 KB
実行使用メモリ 126,384 KB
最終ジャッジ日時 2023-10-21 00:08:42
合計ジャッジ時間 12,768 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
126,324 KB
testcase_01 AC 215 ms
126,324 KB
testcase_02 AC 222 ms
126,324 KB
testcase_03 AC 216 ms
126,324 KB
testcase_04 AC 188 ms
126,324 KB
testcase_05 AC 210 ms
126,324 KB
testcase_06 AC 222 ms
126,324 KB
testcase_07 AC 221 ms
126,380 KB
testcase_08 AC 234 ms
126,380 KB
testcase_09 AC 223 ms
126,380 KB
testcase_10 AC 205 ms
126,380 KB
testcase_11 AC 218 ms
126,380 KB
testcase_12 AC 200 ms
126,380 KB
testcase_13 AC 221 ms
126,380 KB
testcase_14 AC 205 ms
126,380 KB
testcase_15 AC 201 ms
126,324 KB
testcase_16 AC 201 ms
126,324 KB
testcase_17 AC 194 ms
126,324 KB
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 242 ms
126,324 KB
testcase_21 AC 222 ms
126,324 KB
testcase_22 AC 231 ms
126,324 KB
testcase_23 AC 221 ms
126,324 KB
testcase_24 AC 242 ms
126,324 KB
testcase_25 AC 229 ms
126,380 KB
testcase_26 AC 235 ms
126,324 KB
testcase_27 AC 236 ms
126,324 KB
testcase_28 AC 212 ms
126,380 KB
testcase_29 AC 230 ms
126,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
char cntA[300*300*300*3+1];
char cntB[300*300*300*3+1];

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  time_t c=clock();
  int X;
  cin>>X;
  vector C(301,vector(0,0)),D(301,vector(0,0));
  for(int i=0;i<=300;i++){
    for(int j=i;j<=300;j++){
      for(int k=j;k<=300;k++){
        int t=i*i*i+j*j*j+k*k*k;
        C[k].push_back(t);
        D[i].push_back(t);
      }
    }
  }
  for(int i=0;i<=300;i++){
    for(int j:C[i]){
      cntB[j]+=1;
    }
  }
  int ans=0;
  for(int i=0;i<=300;i++){
    for(int j:C[i]){
      if(X-j>=0)
      ans+=cntB[X-j];
    }
    for(int j:D[i]){
      cntB[j]-=1;
    }
  }
  cout<<ans<<'\n';
}
0