Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136389 | 刘嘉柚 | 组合问题 | C++ | 通过 | 100 | 4 MS | 252 KB | 249 | 2024-03-09 09:03:47 |
#include<bits/stdc++.h> using namespace std; int n,k,a[25]; void f(int y){ if(k==y){ for(int i=0;i<k;i++) cout<<a[i]; cout<<endl;return; } for(int i=a[y-1]+1;i<=n;++i){ a[y]=i; f(y+1); } } int main(){ cin>>n>>k; f(0); }