Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
136737 | 李树强 | 组合问题 | C++ | 通过 | 100 | 4 MS | 240 KB | 321 | 2024-03-09 14:53:10 |
#include<iostream> using namespace std; const int N = 30; int a[N], n, m; void f(int x){ if(x == m + 1){ for(int i = 1; i <= m; i++) cout << a[i]; cout << endl; return; } for(int i = a[x-1] + 1; i <= n; i++){ a[x] = i; f(x + 1); } } int main(){ cin >> n >> m; f(1); return 0; }