結果

問題 No.1318 ABCD quadruplets
ユーザー stoqstoq
提出日時 2020-12-16 06:52:45
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 371 ms / 2,000 ms
コード長 776 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 32,352 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 08:58:42
合計ジャッジ時間 4,603 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 7 ms
4,348 KB
testcase_14 AC 134 ms
4,348 KB
testcase_15 AC 4 ms
4,348 KB
testcase_16 AC 179 ms
4,348 KB
testcase_17 AC 13 ms
4,348 KB
testcase_18 AC 117 ms
4,348 KB
testcase_19 AC 49 ms
4,348 KB
testcase_20 AC 6 ms
4,348 KB
testcase_21 AC 21 ms
4,348 KB
testcase_22 AC 16 ms
4,348 KB
testcase_23 AC 371 ms
4,348 KB
testcase_24 AC 339 ms
4,348 KB
testcase_25 AC 71 ms
4,348 KB
testcase_26 AC 39 ms
4,348 KB
testcase_27 AC 236 ms
4,348 KB
testcase_28 AC 82 ms
4,348 KB
testcase_29 AC 105 ms
4,348 KB
testcase_30 AC 371 ms
4,348 KB
testcase_31 AC 76 ms
4,348 KB
testcase_32 AC 371 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:6:1: warning: return type defaults to 'int' [-Wimplicit-int]
    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;
  int p[4] = {24, 12, 4, 1};
  for (a = 0; a * a <= n && a <= m; a++)
  {
    for (b = a; a * a + a * b + b * b <= n && b <= m; b++)
      for (c = b; a * a + b * b + c * c + a * b + b * c <= n && c <= m; c++)
      {
        for (d = c; t = a * a + b * b + c * c + d * d + a * b + a * c + a * d + b * c + b * d + c * d, t <= n && d <= m; d++)
        {
          if (a == b && b < c && c == d)
            cnt[t] += 6;
          else
            cnt[t] += p[(a == b) + (b == c) + (c == d)];
        }
      }
  }
  for (i = 0; i <= n; i++)
    printf("%d\n", cnt[i]);
}
0