結果

問題 No.2763 Macaron Gift Box
ユーザー 矢澤式WINTER矢澤式WINTER
提出日時 2024-05-17 23:12:22
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 1,909 bytes
コンパイル時間 5,027 ms
コンパイル使用メモリ 329,408 KB
実行使用メモリ 813,812 KB
最終ジャッジ日時 2024-05-17 23:12:30
合計ジャッジ時間 7,153 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,812 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,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 MLE -
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>;
  queue<fps> q;
  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;
    q.push(now);
  }
  while (q.size() >= 2) {
    fps a = q.front(); q.pop();
    fps b = q.front(); q.pop();
    fps res = convolution(a,b);
    while(res.size() > n+1) res.pop_back();
    q.push(res);
  }
  fps f = q.front(),g = q.front();
  // 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 << f[i].val() << " ";
  cout << endl;
}


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