結果
| 問題 | 
                            No.1318 ABCD quadruplets
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Nachia
                         | 
                    
| 提出日時 | 2020-12-22 20:46:25 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 613 bytes | 
| コンパイル時間 | 1,950 ms | 
| コンパイル使用メモリ | 193,660 KB | 
| 最終ジャッジ日時 | 2025-01-17 06:10:13 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | AC * 5 WA * 25 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         UL N,M; scanf("%u%u",&N,&M);
      |                 ~~~~~^~~~~~~~~~~~~~
            
            ソースコード
#include<bits/stdc++.h>
using UL=unsigned int;
#define rep(i,n) for(UL i=0; i<(n); i++)
UL A[262144]={}; UL fx;
#define F(a,b,c,d) a*a+(b+c+d)*(a+b)+c*c+d*(c+d)
#define adA(a,b,c,d,x) fx=F(a,b,c,d); if(fx<=N) A[fx]+=x;
int main(){
	UL N,M; scanf("%u%u",&N,&M);
	rep(a,M+1){
		if(F(a,0,0,0)>N) break;
		adA(a,a,a,a,1)
		rep(b,a){
			if(F(a,b,0,0)>N) break;
			adA(a,b,b,b,4)
			adA(a,a,b,b,6)
			adA(a,a,a,b,4)
			rep(c,b){
				if(F(a,b,c,0)>N) break;
				adA(a,b,c,c,12)
				adA(a,b,b,c,12)
				adA(a,a,b,c,12)
				rep(d,c) adA(a,b,c,d,24) else break;
			}
		}
	}
	rep(i,N+1) printf("%u\n",A[i]);
	return 0;
}
            
            
            
        
            
Nachia