結果
| 問題 |
No.3030 Kruskal-Katona
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-21 22:49:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 569 bytes |
| コンパイル時間 | 2,537 ms |
| コンパイル使用メモリ | 196,516 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-21 22:50:19 |
| 合計ジャッジ時間 | 3,700 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 5 WA * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vl = std::vector<ll> ;
void calc(ll N, int i, Vl& A, int up = (int)(1e8 + 6)) {
if (N == 0) {
return;
}
if (i == 1) {
A.push_back(N);
return;
}
ll p = 1, s = 1;
ll n = i;
while ((s <= N) && (n < up)) {
p = s;
s *= (n + 1);
s *= (n - i + 1);
n ++;
}
n --;
A.push_back(n);
calc(N - p, i-1, A, n);
return;
}
int main () {
int N, i;
cin >> N >> i;
Vl ans;
calc(N, i, ans);
for (int i = 0; i < ans.size(); i ++) {
cout << (i ? " " : "") << ans[i];
}
cout << endl;
}