結果

問題 No.1318 ABCD quadruplets
ユーザー 👑 tatyamtatyam
提出日時 2020-07-12 03:52:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 569 bytes
コンパイル時間 3,695 ms
コンパイル使用メモリ 209,556 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-04-21 21:37:04
合計ジャッジ時間 23,733 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,984 KB
testcase_01 AC 5 ms
9,856 KB
testcase_02 AC 5 ms
10,112 KB
testcase_03 AC 5 ms
10,044 KB
testcase_04 AC 4 ms
9,836 KB
testcase_05 AC 5 ms
9,952 KB
testcase_06 AC 5 ms
9,856 KB
testcase_07 AC 5 ms
9,816 KB
testcase_08 AC 5 ms
9,984 KB
testcase_09 AC 5 ms
9,984 KB
testcase_10 AC 5 ms
9,940 KB
testcase_11 AC 5 ms
10,032 KB
testcase_12 AC 5 ms
9,848 KB
testcase_13 AC 29 ms
9,912 KB
testcase_14 AC 968 ms
9,856 KB
testcase_15 AC 10 ms
9,940 KB
testcase_16 AC 1,306 ms
9,880 KB
testcase_17 AC 26 ms
9,928 KB
testcase_18 AC 842 ms
9,984 KB
testcase_19 AC 263 ms
9,856 KB
testcase_20 AC 27 ms
9,924 KB
testcase_21 AC 113 ms
9,800 KB
testcase_22 AC 21 ms
9,840 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 426 ms
9,876 KB
testcase_26 AC 174 ms
9,816 KB
testcase_27 AC 1,811 ms
9,836 KB
testcase_28 AC 517 ms
10,012 KB
testcase_29 AC 698 ms
9,856 KB
testcase_30 TLE -
testcase_31 AC 464 ms
10,012 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using uint = uint32_t;

int main(){
    uint n, m;
    cin >> n >> m;
    uint ans[1600001] = {};
    for(uint a = 0; a <= m; a++) for(uint b = 0; b <= m; b++) for(uint c = 0; c <= m; c++){
        uint x = a * a + a * b + a * c + b * b + b * c + c * c;
        uint y = a + b + c;
        for(uint d = 0, k = x; d <= m && k <= n; d++, k += y + d + d - 1) ans[k]++;
    }
    for(uint i = 0; i <= n; i++) printf("%u\n", ans[i]);
}
0