2 条题解

  • 0
    @ 2025-3-8 15:16:42
    #include<bits/stdc++.h>
    using namespace std;
    const int N=1e5+5,INF=0x3f3f3f3f;
    typedef long long LL;
    int a,b[9];
    int ans;
    int main()
    {
    	cin>>a;
    	for(int i=1;i<=a;i++)b[i] = i;
    	do{
    		for(int i=1;i<=a;i++)printf("%5d",b[i]);
    		cout<<endl;
    	}while(next_permutation(b+1,b+a+1));
    	return 0;
    }
    

    信息

    ID
    2275
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    145
    已通过
    71
    上传者