結果

問題 No.2510 Six Cube Sum Counting
ユーザー 👑 chro_96chro_96
提出日時 2023-10-20 21:53:03
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 175 ms / 4,000 ms
コード長 660 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 30,148 KB
実行使用メモリ 318,284 KB
最終ジャッジ日時 2023-10-20 21:53:46
合計ジャッジ時間 6,342 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
318,284 KB
testcase_01 AC 154 ms
318,284 KB
testcase_02 AC 160 ms
318,284 KB
testcase_03 AC 159 ms
318,284 KB
testcase_04 AC 155 ms
318,284 KB
testcase_05 AC 154 ms
318,284 KB
testcase_06 AC 153 ms
318,284 KB
testcase_07 AC 167 ms
318,284 KB
testcase_08 AC 153 ms
318,284 KB
testcase_09 AC 153 ms
318,284 KB
testcase_10 AC 156 ms
318,284 KB
testcase_11 AC 154 ms
318,284 KB
testcase_12 AC 155 ms
318,284 KB
testcase_13 AC 151 ms
318,284 KB
testcase_14 AC 169 ms
318,284 KB
testcase_15 AC 152 ms
318,284 KB
testcase_16 AC 157 ms
318,284 KB
testcase_17 AC 153 ms
318,284 KB
testcase_18 AC 158 ms
318,284 KB
testcase_19 AC 155 ms
318,284 KB
testcase_20 AC 159 ms
318,284 KB
testcase_21 AC 175 ms
318,284 KB
testcase_22 AC 161 ms
318,284 KB
testcase_23 AC 160 ms
318,284 KB
testcase_24 AC 163 ms
318,284 KB
testcase_25 AC 156 ms
318,284 KB
testcase_26 AC 157 ms
318,284 KB
testcase_27 AC 162 ms
318,284 KB
testcase_28 AC 161 ms
318,284 KB
testcase_29 AC 163 ms
318,284 KB
権限があれば一括ダウンロードができます

ソースコード

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 = a; 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