結果

問題 No.1318 ABCD quadruplets
ユーザー 👑 tatyamtatyam
提出日時 2020-07-12 04:09:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 894 bytes
コンパイル時間 2,277 ms
コンパイル使用メモリ 193,392 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-04-21 21:36:23
合計ジャッジ時間 12,624 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
19,200 KB
testcase_01 AC 8 ms
9,728 KB
testcase_02 AC 8 ms
9,856 KB
testcase_03 AC 9 ms
9,856 KB
testcase_04 AC 8 ms
9,728 KB
testcase_05 AC 9 ms
9,728 KB
testcase_06 AC 8 ms
9,856 KB
testcase_07 AC 8 ms
9,984 KB
testcase_08 AC 8 ms
9,856 KB
testcase_09 AC 8 ms
9,728 KB
testcase_10 AC 8 ms
9,728 KB
testcase_11 AC 8 ms
9,856 KB
testcase_12 AC 8 ms
9,728 KB
testcase_13 AC 33 ms
9,728 KB
testcase_14 AC 103 ms
9,856 KB
testcase_15 AC 11 ms
9,856 KB
testcase_16 AC 1,474 ms
9,728 KB
testcase_17 AC 16 ms
9,856 KB
testcase_18 AC 95 ms
9,984 KB
testcase_19 AC 40 ms
9,728 KB
testcase_20 AC 23 ms
9,856 KB
testcase_21 AC 66 ms
9,728 KB
testcase_22 AC 19 ms
9,728 KB
testcase_23 TLE -
testcase_24 AC 674 ms
9,856 KB
testcase_25 AC 54 ms
9,728 KB
testcase_26 AC 34 ms
9,856 KB
testcase_27 AC 214 ms
9,728 KB
testcase_28 AC 60 ms
9,856 KB
testcase_29 AC 74 ms
9,984 KB
testcase_30 TLE -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n, m;
    cin >> n >> m;
    int ans[1600001] = {};
    for(int a = 0; a <= m; a++) for(int b = 0; b <= a; b++) for(int c = 0; c <= b; c++) for(int d = 0; d <= c; d++){
        const int k = a * a + a * b + a * c + a * d + b * b + b * c + b * d + c * c + c * d + d * d;
        if(a == b){
            if(b == c){
                if(c == d) ans[k] += 1;
                else ans[k] += 4;
            }
            else{
                if(c == d) ans[k] += 6;
                else ans[k] += 12;
            }
        }
        else{
            if(b == c){
                if(c == d) ans[k] += 4;
                else ans[k] += 12;
            }
            else{
                if(c == d) ans[k] += 12;
                else ans[k] += 24;
            }
        }
    }
    for(int i = 0; i <= n; i++) cout << ans[i] << '\n';
}
0