| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 139284 | mairuisheng | 单词接龙 | C++ | Output Limit Exceeded | 0 | 0 MS | 248 KB | 426 | 2024-03-22 22:55:39 |
#include <bits/stdc++.h> using namespace std; const int N=1e2+10; const int INF=0x3f3f3f3f; int n,a[N],f[N],ans; void dfs(int x) { if(x==n) { for(int i=1; i<=x; i++) { cout<<a[i]; } cout<<endl; ans++; return; } for(int i=1; i<=n; i++) { if(f[i]==0) { f[i]=1; a[x+1]=i; dfs(x+1); f[i]=0; } a[x+1]=0; } } int main() { cin >> n; dfs(0); cout << ans; return 0; }