結果

問題 No.1318 ABCD quadruplets
ユーザー tko919tko919
提出日時 2020-12-25 16:18:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,028 ms / 2,000 ms
コード長 1,097 bytes
コンパイル時間 2,753 ms
コンパイル使用メモリ 169,088 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 07:59:25
合計ジャッジ時間 10,577 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 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 15 ms
4,348 KB
testcase_14 AC 86 ms
4,348 KB
testcase_15 AC 4 ms
4,348 KB
testcase_16 AC 484 ms
4,348 KB
testcase_17 AC 11 ms
4,348 KB
testcase_18 AC 80 ms
4,348 KB
testcase_19 AC 33 ms
4,348 KB
testcase_20 AC 10 ms
4,348 KB
testcase_21 AC 34 ms
4,348 KB
testcase_22 AC 13 ms
4,348 KB
testcase_23 AC 786 ms
4,348 KB
testcase_24 AC 335 ms
4,348 KB
testcase_25 AC 45 ms
4,348 KB
testcase_26 AC 27 ms
4,348 KB
testcase_27 AC 162 ms
4,348 KB
testcase_28 AC 52 ms
4,348 KB
testcase_29 AC 65 ms
4,348 KB
testcase_30 AC 992 ms
4,348 KB
testcase_31 AC 48 ms
4,348 KB
testcase_32 AC 1,028 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0