Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
136316 罗嘉为 组合问题 C++ 通过 100 4 MS 256 KB 397 2024-03-09 08:36:42

Tests(12/12):


#include <bits/stdc++.h> using namespace std; int n, r, res[1100000], vis[1100000]; void dfs(int cur){ if(cur > r){ for(int i = 1; i <= r; i++){ cout << res[i]; } cout << endl; return ; } for(int i = res[cur - 1] + 1; i <= n; i++){ res[cur] = i; dfs(cur + 1); } } int main(){ cin >> n >> r; dfs(1); return 0; }


测评信息: