結果
| 問題 |
No.3030 Kruskal-Katona
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-21 22:00:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 848 bytes |
| コンパイル時間 | 2,185 ms |
| コンパイル使用メモリ | 193,604 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-21 22:00:31 |
| 合計ジャッジ時間 | 6,532 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 1 OLE * 1 -- * 21 |
ソースコード
#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;
long long ret = 1;
for(int i=1; i<=r; i++){
ret *= n--,ret /= i;
if(ret >= 1001001001) return ret;
}
return ret;
};
int N,i; cin >> N >> i;
bool space = false;
while(N){
if(space) cout << " ";
space = true;
int low = i,high = 1001001001;
while(high-low > 1){
int mid = (high+low)/2;
if(nCr(mid,i) > N) high = mid;
else low = mid;
}
cout << low;
N -= nCr(low,i); i--;
}
cout << endl;
}