結果

問題 No.1318 ABCD quadruplets
ユーザー 👑 NachiaNachia
提出日時 2020-12-22 20:27:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 702 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 201,956 KB
実行使用メモリ 7,544 KB
最終ジャッジ日時 2023-10-21 13:03:25
合計ジャッジ時間 7,792 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 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 25 ms
6,400 KB
testcase_14 AC 231 ms
6,400 KB
testcase_15 AC 24 ms
4,348 KB
testcase_16 RE -
testcase_17 AC 142 ms
4,348 KB
testcase_18 AC 211 ms
6,400 KB
testcase_19 AC 197 ms
6,400 KB
testcase_20 AC 23 ms
6,352 KB
testcase_21 AC 54 ms
6,400 KB
testcase_22 AC 206 ms
4,348 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 234 ms
6,400 KB
testcase_26 AC 218 ms
6,400 KB
testcase_27 AC 313 ms
7,108 KB
testcase_28 AC 236 ms
6,400 KB
testcase_29 AC 243 ms
6,400 KB
testcase_30 RE -
testcase_31 AC 236 ms
6,400 KB
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; }

ULL A[524288]={};

int main(){
	int N,M; cin>>N>>M; M++;
	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[x]+=24; else break;
				}
			}
		}
	}
	rep(i,N+1) cout<<A[i]<<endl;

	return 0;
}
0