結果

問題 No.2510 Six Cube Sum Counting
ユーザー SSRSSSRS
提出日時 2023-10-20 21:37:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3,713 ms / 4,000 ms
コード長 548 bytes
コンパイル時間 2,307 ms
コンパイル使用メモリ 208,300 KB
実行使用メモリ 174,884 KB
最終ジャッジ日時 2023-10-20 21:39:25
合計ジャッジ時間 29,938 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,143 ms
174,884 KB
testcase_01 AC 3,133 ms
174,884 KB
testcase_02 AC 3,015 ms
174,884 KB
testcase_03 AC 3,054 ms
174,884 KB
testcase_04 AC 3,019 ms
174,884 KB
testcase_05 AC 3,545 ms
174,884 KB
testcase_06 AC 3,358 ms
174,884 KB
testcase_07 AC 3,480 ms
174,884 KB
testcase_08 AC 3,512 ms
174,884 KB
testcase_09 AC 3,596 ms
174,884 KB
testcase_10 AC 3,460 ms
174,884 KB
testcase_11 AC 3,713 ms
174,884 KB
testcase_12 AC 3,515 ms
174,884 KB
testcase_13 AC 3,388 ms
174,884 KB
testcase_14 AC 3,410 ms
174,884 KB
testcase_15 AC 3,390 ms
174,884 KB
testcase_16 AC 3,370 ms
174,884 KB
testcase_17 AC 3,399 ms
174,884 KB
testcase_18 AC 3,321 ms
174,884 KB
testcase_19 AC 3,389 ms
174,884 KB
testcase_20 AC 3,422 ms
174,884 KB
testcase_21 AC 3,323 ms
174,884 KB
testcase_22 AC 3,442 ms
174,884 KB
testcase_23 AC 3,456 ms
174,884 KB
testcase_24 AC 3,386 ms
174,884 KB
testcase_25 AC 3,349 ms
174,884 KB
testcase_26 AC 3,368 ms
174,884 KB
testcase_27 AC 3,364 ms
174,884 KB
testcase_28 AC 3,355 ms
174,884 KB
testcase_29 AC 3,372 ms
174,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MAX = 300;
int main(){
  int X;
  cin >> X;
  int ans = 0;
  unordered_map<int, int> mp;
  for (int i = 0; i <= MAX; i++){
    for (int j = 0; j <= i; j++){
      for (int k = j; k <= i; k++){
        mp[j * j * j + k * k * k + i * i * i]++;
      }
    }
    for (int j = i; j <= MAX; j++){
      for (int k = j; k <= MAX; k++){
        int s = X - i * i * i - j * j * j - k * k * k;
        if (mp.count(s) != 0){
          ans += mp[s];
        }
      }
    }
  }
  cout << ans << endl;
}
0