結果

問題 No.1318 ABCD quadruplets
ユーザー auauaauaua
提出日時 2020-12-19 14:38:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 303 ms / 2,000 ms
コード長 2,054 bytes
コンパイル時間 2,607 ms
コンパイル使用メモリ 169,272 KB
実行使用メモリ 4,624 KB
最終ジャッジ日時 2023-10-21 09:13:07
合計ジャッジ時間 5,750 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 6 ms
4,348 KB
testcase_14 AC 87 ms
4,360 KB
testcase_15 AC 3 ms
4,348 KB
testcase_16 AC 134 ms
4,348 KB
testcase_17 AC 10 ms
4,348 KB
testcase_18 AC 78 ms
4,360 KB
testcase_19 AC 31 ms
4,360 KB
testcase_20 AC 5 ms
4,348 KB
testcase_21 AC 15 ms
4,348 KB
testcase_22 AC 13 ms
4,624 KB
testcase_23 AC 295 ms
4,624 KB
testcase_24 AC 257 ms
4,624 KB
testcase_25 AC 44 ms
4,624 KB
testcase_26 AC 26 ms
4,624 KB
testcase_27 AC 181 ms
4,624 KB
testcase_28 AC 52 ms
4,624 KB
testcase_29 AC 64 ms
4,624 KB
testcase_30 AC 296 ms
4,624 KB
testcase_31 AC 47 ms
4,624 KB
testcase_32 AC 303 ms
4,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll inf=INF*INF;
const int mod=1e9+7;
const ll MAX=500010;
const double PI=acos(-1.0);




signed main(){
    ll n,m;cin>>n>>m;
    vector<ll>ans(n+1);
    rep(i,m+1){
        REP(j,i,m+1){
            REP(k,j,m+1){
                ll x=i*i+j*j+k*k+i*j+j*k+k*i;
                ll y=i+j+k;
                ll d=k;
                while(d<=m&&d*d+x+y*d<=n){
                    ll z=d*d+x+d*y;
                    if(i<j){
                        if(j<k){
                            if(k<d){
                                ans[z]+=24;
                            }else{
                                ans[z]+=12;
                            }
                        }else{
                            if(k<d){
                                ans[z]+=12;
                            }else{
                                ans[z]+=4;
                            }
                        }
                    }else{
                        if(j<k){
                            if(k<d){
                                ans[z]+=12;
                            }else{
                                ans[z]+=6;
                            }
                        }else{
                            if(k<d){
                                ans[z]+=4;
                            }else{
                                ans[z]+=1;
                            }
                        }
                    }
                    d++;
                }
            }
        }
    }
    rep(i,n+1){
        cout<<ans[i]<<endl;
    }
}
0