結果

問題 No.1318 ABCD quadruplets
ユーザー stoqstoq
提出日時 2020-12-16 06:23:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 695 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 33,352 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-20 08:57:53
合計ジャッジ時間 6,577 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 104 ms
4,348 KB
testcase_14 TLE -
testcase_15 AC 14 ms
4,348 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include <stdio.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

main()
{
  int n, m;
  scanf("%d %d", &n, &m);
  int cnt[160010] = {};
  int a, b, c, d, t, i;
  for (a = 0; a * a <= n and a <= m; a++)
  {
    for (b = 0; b * b <= n - a * a and b <= m; b++)
      for (c = 0; c * c <= n - a * a - a * b - b * b and c <= m; c++)
      {
        for (d = 0; d * d <= n - a * a - b * b - c * c - a * b - b * c and d <= m; d++)
        {
          t = a * a + b * b + c * c + d * d + a * b + a * c + a * d + b * c + b * d + c * d;
          if (t <= n)
            cnt[t]++;
        }
      }
  }
  for (i = 0; i <= n; i++)
    printf("%d\n", cnt[i]);
}
0