結果
| 問題 |
No.2763 Macaron Gift Box
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-17 23:12:22 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,909 bytes |
| コンパイル時間 | 6,362 ms |
| コンパイル使用メモリ | 329,004 KB |
| 実行使用メモリ | 814,684 KB |
| 最終ジャッジ日時 | 2024-12-20 15:14:58 |
| 合計ジャッジ時間 | 21,513 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 MLE * 10 |
ソースコード
#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();
}