結果

問題 No.1318 ABCD quadruplets
コンテスト
ユーザー vjudge1
提出日時 2026-02-11 02:36:45
言語 C++17
(gcc 15.2.0 + boost 1.89.0)
結果
TLE  
実行時間 -
コード長 501 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,822 ms
コンパイル使用メモリ 82,808 KB
実行使用メモリ 16,196 KB
最終ジャッジ日時 2026-02-11 02:36:58
合計ジャッジ時間 5,480 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
using namespace std;

int f(int n, int m){

    int count = 0;

    for (int a=0;a<=m;a++){
        for (int b=0; b<=m;b++){
            for(int c=0; c<=m; c++){
                for(int d =0;d<=m;d++){
                    if((a*(a+b+c+d) + b*(b+c+d) + c*(c+d) + d*d) == n){count++;}

                }
            }
        }
    }

    return count;

}



int main(){
    int n,m;

    cin >> n;
    cin >> m;

    for (int i=0;i<=n;i++){
        cout << f(i,m) << endl;
    }


}
0