結果
| 問題 | No.3030 Kruskal-Katona |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-21 22:16:33 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 819 bytes |
| 記録 | |
| コンパイル時間 | 1,014 ms |
| コンパイル使用メモリ | 214,756 KB |
| 実行使用メモリ | 9,228 KB |
| 最終ジャッジ日時 | 2026-07-05 00:11:38 |
| 合計ジャッジ時間 | 2,105 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void Yes(){cout << "YES\n";}
void No(){cout << "NO\n";}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
auto nCr = [&](long long n,long long r) -> long long {
if(n < r || n < 0 || r < 0) return 0;
r = min(r,n-r);
long long ret = 1;
for(int i=1; i<=r; i++) ret *= n--,ret /= i;
return ret;
};
int N; int i; cin >> N >> i;
bool space = false;
while(N > 0){
if(space) cout << " ";
space = true;
if(i == 1){cout << N; break;}
int now = i;
while(true){
now++;
long long v = nCr(now,i);
if(v > N) break;
}
now--;
cout << now;
N -= nCr(now,i); i--;
}
cout << endl;
}