結果

問題 No.2763 Macaron Gift Box
ユーザー 矢澤式WINTER矢澤式WINTER
提出日時 2024-05-17 23:15:08
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,749 bytes
コンパイル時間 5,923 ms
コンパイル使用メモリ 324,604 KB
実行使用メモリ 14,120 KB
最終ジャッジ日時 2024-05-17 23:15:19
合計ジャッジ時間 10,642 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,888 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,948 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
//*/
#include <atcoder/all>
using namespace atcoder;
//*/
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define ALL(x) (x).begin(),(x).end()
#define dbgv(x); for(auto now : x) cout << now << " "; cout << endl;
//using P = pair<int,int>;
using ll = long long;
using ull = unsigned long long;
//*/
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vint;
random_device rnd;
mt19937 rng(rnd());

struct Trie {
  struct Node {
    unordered_map<char,int> to;
    int cnt;
    Node(): cnt(0) {}
  };
  vector<Node> d;
  Trie(): d(1) {}
  void add(const string& s) {
    int v = 0;
    for (char c : s) {
      if (!d[v].to.count(c)) {
        d[v].to[c] = d.size();
        d.push_back(Node());
      }
      v = d[v].to[c];
    }
    d[v].cnt++;
  }
};

using mint = modint998244353;

void solve(){
  int n,k; cin >> n >> k;
  using fps = vector<mint>;
  fps sur = {1};
  for(int i = 1;i <= n;i++){
    fps now(n+1,0);
    int pos = 0;
    rep(j,k+1)if(i*j <= n) now[i*j] = 1;
    sur = convolution(sur,now);
    while(sur.size() > n+1) sur.pop_back();
  }
  // while(k){
  //   if(k&1) f = convolution(f,g);
  //   while(f.size() > n+1) f.pop_back();
  //   g = convolution(g,g);
  //   while(g.size() > n+1) g.pop_back();
  //   k >>= 1;
  // }
  for(int i = 1;i <= n;i++) cout << sur[i].val() << " ";
  cout << endl;
}


int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t = 1; //cin >> t;
  rep(testcases,t) solve();
}
0