| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 110229 | 樊梵 | 全排列问题 | C++ | Accepted | 100 | 15 MS | 248 KB | 417 | 2023-11-13 13:42:30 |
#include<bits/stdc++.h> using namespace std; int b; int Count,a[105]; bool used[105]; void print() { for(int k=1;k<=b;k++) cout<<a[k]; cout<<"\n"; Count++; } int dfs(int i) { if(i>b) print(); else for(int k=1;k<=b;k++) if(used[k]==0){ used[k]=1; a[i]=k; dfs(i+1); used[k]=0; } } int main() { int a; cin>>b; dfs(1); cout<<Count; }