結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
10,112 KB
testcase_01 AC 8 ms
9,984 KB
testcase_02 AC 9 ms
9,856 KB
testcase_03 AC 8 ms
9,856 KB
testcase_04 AC 8 ms
9,984 KB
testcase_05 AC 8 ms
9,856 KB
testcase_06 AC 8 ms
10,112 KB
testcase_07 AC 8 ms
9,984 KB
testcase_08 AC 8 ms
10,112 KB
testcase_09 AC 8 ms
9,984 KB
testcase_10 AC 8 ms
9,984 KB
testcase_11 AC 8 ms
9,856 KB
testcase_12 AC 8 ms
9,984 KB
testcase_13 AC 30 ms
9,856 KB
testcase_14 AC 989 ms
9,856 KB
testcase_15 AC 14 ms
9,856 KB
testcase_16 AC 1,283 ms
9,984 KB
testcase_17 AC 29 ms
9,856 KB
testcase_18 AC 844 ms
10,112 KB
testcase_19 AC 267 ms
9,856 KB
testcase_20 AC 29 ms
9,984 KB
testcase_21 AC 111 ms
9,856 KB
testcase_22 AC 25 ms
9,984 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 421 ms
9,984 KB
testcase_26 AC 170 ms
9,984 KB
testcase_27 AC 1,809 ms
9,856 KB
testcase_28 AC 516 ms
10,112 KB
testcase_29 AC 707 ms
9,856 KB
testcase_30 TLE -
testcase_31 AC 470 ms
9,856 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx")
#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, x1 = 0; a <= m; a++, x1 += (a << 1) - 1){
        for(uint b = 0, x2 = x1, y2 = a; b <= m && x2 <= n; b++, x2 += a + (b << 1) - 1, y2++){
            for(uint c = 0, x3 = x2, y3 = y2; c <= m && x3 <= n; c++, x3 += y2 + (c << 1) - 1, y3++){
                for(uint d = 0, x4 = x3; d <= m && x4 <= n; d++, x4 += y3 + (d << 1) - 1){
                    ans[x4]++;
                }
            }
        }
    }
    for(uint i = 0; i <= n; i++) printf("%u\n", ans[i]);
}
0