結果

問題 No.1318 ABCD quadruplets
ユーザー 👑 NachiaNachia
提出日時 2020-12-22 20:24:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 2,660 ms
コンパイル使用メモリ 201,640 KB
実行使用メモリ 4,876 KB
最終ジャッジ日時 2023-10-21 13:02:57
合計ジャッジ時間 6,033 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

int F(int a,int b,int c,int d){  int x=a*a; a+=b; x+=a*b; a+=c; x+=a*c; a+=d; x+=a*d; return x; }

int main(){
	int N,M; cin>>N>>M;
	ULL A[160000]={};
	rep(a,M){
		if(F(a,0,0,0)>N) break;
		A[F(a,a,a,a)]+=1;
		rep(b,a){
		  if(F(a,b,0,0)>N) break;
		  A[F(a,b,b,b)]+=4;
		  A[F(a,a,b,b)]+=6;
		  A[F(a,a,a,b)]+=4;
			rep(c,b){
				if(F(a,b,c,0)>N) break;
				A[F(a,b,c,c)]+=12;
				A[F(a,b,b,c)]+=12;
				A[F(a,a,b,c)]+=12;
				rep(d,c){
					int x=F(a,b,c,d);
					if(x<=N) A[N]+=24; else break;
				}
			}
		}
	}
	rep(i,N+1) cout<<A[i]<<endl;

	return 0;
}
0