結果
| 問題 |
No.3030 Kruskal-Katona
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-21 22:15:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 819 bytes |
| コンパイル時間 | 2,022 ms |
| コンパイル使用メモリ | 193,116 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-02-21 22:15:39 |
| 合計ジャッジ時間 | 3,166 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 4 |
ソースコード
#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(i == 1){cout << N; break;}
if(space) cout << " ";
space = true;
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;
}