当前位置:网站首页>[Luogu] p1157 combined output (DFS)
[Luogu] p1157 combined output (DFS)
2022-04-22 21:57:00 【percation】
Recursive enumerative combinatorial type of problem surface micro variant
#include <bits/stdc++.h>
using namespace std;
const int N = 30;
int n,m;
bool st[N];
int path[N];
void dfs(int u, int start){
if(u >= m){
for(int i = 0; i < m; i++){
printf("%3d",path[i]);
}
puts("");
return ;
}
for(int i = start; i <= n; i++){
// Ascending
if(!st[i]){
path[u] = i;
st[i] = true;
dfs(u + 1, i + 1);
st[i] = false;
}
}
}
int main(){
cin >> n >> m;
dfs(0,1);
return 0;
}
版权声明
本文为[percation]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221555022478.html
边栏推荐
- Nonlinear optimization problem --- super large object function optimization problem --- matlab
- What does 302 mean in PHP
- ThingsKit物联网平台
- 故障分析 | Federated 存储引擎表导致监控线程处于 Opening table 状态
- QQ group chat message statistics for Matplotlib data visualization
- 80386 compilation_ Introduction to register & addressing mode
- Quick off-line solution of LCA
- PHP AES encryption and decryption
- hostapd 创建5G热点
- Oplg: new generation cloud primary observable best practices
猜你喜欢

企评家为政府打造决策支撑平台

Alibaba cloud container & Service Grid product technology trends (202203)

Milvus 2.0 质量保障系统详解

Enterprise appraisers build a decision support platform for the government

實驗3

MySQL deadlock analysis and solution caused by index merging!

Brief introduction of Microsoft testers

项目经理值得一试的思维方式:项目成功方程式

Penetration test & Network & CTF interview questions sorting
Android uses SQLite kotlin
随机推荐
Unstable sorting (selection, fast)
逆向入门(三) CE自动汇编后保存CT表并生成exe修改器
Drop down options under playwright operation select
paho.mqtt.c使用的总结
Noise problem at the end of alsa playback
Test life | less than 2 years after graduation, 0 experience and won the 30W annual salary of a well-known Internet enterprise. How did he do it?
关于Libffi
How far is the meta universe from us? That's what the big guys at the Boao Forum said
ES6 object extension chain judgment operator and null judgment operator
實驗3
The principle of training multilayer neural networks using back propagation
一个线程获取内存另一个线程释放内存造成内存泄漏
Milvus 2.0 质量保障系统详解
golang 入门--定义map的6种方式
Practical learning of several small shell scripts
社会工程学之黑客番外——密码学
每日一练(47):找不同
Ampere Computing释放观测云“芯”算力,强强联合推动可观测性发展
One thread gets memory and another thread releases memory, resulting in memory leakage
80386 compilation_ Introduction to register & addressing mode
