結果
| 問題 |
No.1318 ABCD quadruplets
|
| コンテスト | |
| ユーザー |
tko919
|
| 提出日時 | 2020-12-25 16:18:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,054 ms / 2,000 ms |
| コード長 | 1,097 bytes |
| コンパイル時間 | 1,443 ms |
| コンパイル使用メモリ | 168,296 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-09-22 09:01:48 |
| 合計ジャッジ時間 | 8,051 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end
int main(){
int n,m; cin>>n>>m;
vector<int> res(n+1);
rep(a,0,m+1)rep(b,0,a+1)rep(c,0,b+1)rep(d,0,c+1){
int v=a*a+a*b+a*c+a*d+b*b+b*c+b*d+c*c+c*d+d*d;
if(v>n)continue;
if(a==b){
if(b==c){
if(c==d)res[v]++;
else res[v]+=4;
}
else{
if(c==d)res[v]+=6;
else res[v]+=12;
}
}
else{
if(b==c){
if(c==d)res[v]+=4;
else res[v]+=12;
}
else{
if(c==d)res[v]+=12;
else res[v]+=24;
}
}
}
rep(i,0,n+1)cout<<res[i]<<'\n';
return 0;
}
tko919