1 条题解

  • 0
    @ 2021-6-15 12:57:53

    C :

    #include<stdio.h>   //142431395
    //#include <windows.h>
    int main()
    {
    	int num[7]={1,2,3,4,5,9};
    	int vis[7]={0};
    	int a1,a2,a3,a4,a5,a6;
    	int t;
    	int flag=0;
    	int cnt;
    	cnt=0;
    	//unsigned uEndTime;
    	//unsigned uStartTime = GetTickCount();
    	//freopen("in.txt", "r", stdin);
        //freopen("out.txt", "w", stdout);
    	for(a1=0;a1<6;a1++){
    		vis[a1]=1;
    		for(a2=0;a2<6;a2++){
    			if(vis[a2]==1)
    				continue;
    			vis[a2]=1;
    			for(a3=0;a3<6;a3++){
    				if(vis[a3]==1)
    					continue;
    				vis[a3]=1;
    				for(a4=0;a4<6;a4++){
    					if(vis[a4]==1)
    						continue;
    					vis[a4]=1;
    					for(a5=0;a5<6;a5++){
    						if(vis[a5]==1)
    							continue;
    						vis[a5]=1;
    						for(a6=0;a6<6;a6++){
    							if(vis[a6]==1)
    								continue;
    							vis[a6]=1;
    							t=100000000*num[a1]+1000*num[a1]+10000000*num[a2]+100000*num[a2]+1000000*num[a3]+10000*num[a4]+100*num[a4]+10*num[a5]+num[a6];
    							cnt++;
    					//		printf("%d %d\n",t,cnt);
    							if(cnt==50) {
    								printf("%d%d%d%d%d%d%d%d%d\n",num[a1],num[a2],num[a3],num[a2],num[a4],num[a1],num[a4],num[a5],num[a6]);
    								flag=1;
    							}
    							vis[a6]=0;
    							if(flag==1) break;
    						}
    						vis[a5]=0;
    						if(flag==1) break;
    					}
    					vis[a4]=0;
    					if(flag==1) break;
    				}
    				vis[a3]=0;
    				if(flag==1) break;
    			}
    			vis[a2]=0;
    			if(flag==1) break;
    		}
    		vis[a1]=0;
    		if(flag==1) break;
    	}
    	//uEndTime = GetTickCount();
    //	printf("%ums elapsed.\n",uEndTime-uStartTime);
    	//fclose(stdin);
      //  fclose(stdout);
    	return 0;
    }
    
    

    C++ :

    #include<iostream>  //142431395
    using  namespace std;
    int main()
    {
    	cout<<"142431395"<<endl;
    }
    
    • 1

    信息

    ID
    787
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者