题意:
莫名其妙 看不懂。。只能靠别人的题意混日子
a完就懂了 就是 POJ1392 不求第k个了 直接输出这个路径
emm 。。。就改了一下那个代码
#include <iostream>
#include <cstdio>
#include <sstream>
#include <cstring>
#include <map>
#include <cctype>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#define rap(i, a, n) for(int i=a; i<=n; i++)
#define rep(i, a, n) for(int i=a; i<n; i++)
#define lap(i, a, n) for(int i=n; i>=a; i--)
#define lep(i, a, n) for(int i=n; i>a; i--)
#define rd(a) scanf("%d", &a)
#define rlld(a) scanf("%lld", &a)
#define rc(a) scanf("%c", &a)
#define rs(a) scanf("%s", a)
#define pd(a) printf("%d\n", a);
#define plld(a) printf("%lld\n", a);
#define pc(a) printf("%c\n", a);
#define ps(a) printf("%s\n", a);
#define MOD 2018
#define LL long long
#define ULL unsigned long long
#define Pair pair<int, int>
#define mem(a, b) memset(a, b, sizeof(a))
#define _ ios_base::sync_with_stdio(0),cin.tie(0)
//freopen("1.txt", "r", stdin);
using namespace std;
const int maxn = , INF = 0x7fffffff, LL_INF = 0x7fffffffffffffff;
int f[ << maxn], vis[ << maxn][], stk[ << maxn];
int n, k, tot; void fleury(int u)
{
for(int i = ; i <= ; i++)
{
if(!vis[u][i])
{
vis[u][i] = ;
fleury(((u << ) + i) % f[n - ]);
stk[tot++] = i;
}
}
} int main()
{
f[] = ;
for(int i = ; i < ; i++)
f[i] = f[i-] * ;
while(cin >> n)
{
mem(vis, );
mem(stk, );
cout << f[n] << " ";
tot = ;
fleury();
tot += n - ;
for(int i = tot; i > n - ; i--)
cout << stk[i];
cout << endl; } return ;
}