結果
| 問題 | 
                            No.1318 ABCD quadruplets
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-12-15 00:40:01 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 219 ms / 2,000 ms | 
| コード長 | 1,677 bytes | 
| コンパイル時間 | 1,402 ms | 
| コンパイル使用メモリ | 111,980 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-20 01:07:22 | 
| 合計ジャッジ時間 | 4,544 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 30 | 
ソースコード
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx2")
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
int N, M;
int main() {
  for (; ~scanf("%d%d", &N, &M); ) {
    int ans[160'010] = {};
    for (int a = 0; a <= M; ++a) {
      for (int b = 0; b <= a; ++b) {
        for (int c = 0; c <= b; ++c) {
          for (int d = 0; d <= c; ++d) {
            const int s = ((a+b+c+d)*(a+b+c+d) + a*a + b*b + c*c + d*d) / 2;
            if (s > N) {
              break;
            }
            ans[s] += ((b > c) ? (a > b) ? (c > d) ? 24 : 12 : (c > d) ? 12 : 6
                               : (a > b) ? (c > d) ? 12 : 4 : (c > d) ? 4 : 1);
          }
        }
      }
    }
    for (int s = 0; s <= N; ++s) {
      printf("%d\n", ans[s]);
    }
  }
  return 0;
}