結果
問題 | No.3030 Kruskal-Katona |
ユーザー |
![]() |
提出日時 | 2025-02-21 22:19:53 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 984 bytes |
コンパイル時間 | 7,477 ms |
コンパイル使用メモリ | 464,360 KB |
実行使用メモリ | 813,604 KB |
最終ジャッジ日時 | 2025-02-21 22:20:10 |
合計ジャッジ時間 | 10,828 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | MLE * 1 -- * 2 |
other | -- * 27 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;#include <boost/multiprecision/cpp_int.hpp>typedef boost::multiprecision::cpp_int bint;#pragma GCC optimize("O3")int main(){ios::sync_with_stdio(false);cin.tie(nullptr);vector<bint> fact(100010);fact[0] = fact[1] = 1;for (int i = 2; i < 100010; i++) {fact[i] = fact[i-1] * i;}auto comb = [&fact](int n, int r){return fact[n] / fact[r] / fact[n-r];};bint N;int i;cin >> N >> i;vector<int> ans;for (; 1 <= i; i--) {if(i == 1){ans.push_back((int)N);break;}auto j = i;while(1){if(comb(j, i) <= N){j++;}else{ans.push_back(j-1);N -= comb(j-1, i);break;}}if(N == 0) break;}for (int i = 0; i < ssize(ans); i++) {if(i) cout << ' ';cout << ans[i];}cout << '\n';return 0;}/*File : ~/yukicoder/528/D.cppDate : 2025/02/21Time : 22:00:54*/