結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 chro_96chro_96
提出日時 2023-10-20 21:51:39
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 1,818 ms
コンパイル使用メモリ 29,868 KB
実行使用メモリ 318,284 KB
最終ジャッジ日時 2023-10-20 21:52:24
合計ジャッジ時間 7,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 187 ms
318,284 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 193 ms
318,284 KB
testcase_04 AC 189 ms
318,284 KB
testcase_05 AC 190 ms
318,284 KB
testcase_06 WA -
testcase_07 AC 198 ms
318,284 KB
testcase_08 WA -
testcase_09 AC 191 ms
318,284 KB
testcase_10 AC 191 ms
318,284 KB
testcase_11 WA -
testcase_12 AC 194 ms
318,284 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 191 ms
318,284 KB
testcase_16 AC 225 ms
318,284 KB
testcase_17 AC 193 ms
318,284 KB
testcase_18 AC 198 ms
318,284 KB
testcase_19 AC 192 ms
318,284 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 189 ms
318,284 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main () {
  int x = 0;
  
  int res = 0;
  
  long long ans = 0LL;
  int cnt[81000001] = {};
  int pow[301] = {};
  
  res = scanf("%d", &x);
  
  for (int i = 0; i <= 300; i++) {
    pow[i] = i*i*i;
  }
  
  for (int d = 0; d <= 300; d++) {
    for (int a = 0; a <= d; a++) {
      for (int b = 0; b <= d; b++) {
        cnt[pow[a]+pow[b]+pow[d]]++;
      }
    }
    for (int e = d; e <= 300; e++) {
      for (int f = e; f <= 300; f++) {
        int tmp = pow[d]+pow[e]+pow[f];
        if (tmp <= x && x-tmp <= pow[d]*3) {
          ans += (long long)cnt[x-tmp];
        }
      }
    }
  }
  
  printf("%lld\n", ans);
  return 0;
}
0