当前位置:编程学习 > C/C++ >>

POJ 2965 The Pilots Brothers' refrigerator 枚举

[cpp]
颤抖吧凡人~这才是真正的暴力枚举!!!枚举16个点的状态分别判断...真的...这样也能过... 
[cpp] 
#include <set> 
#include <list> 
#include <cmath> 
#include <ctime> 
#include <deque> 
#include <queue> 
#include <stack> 
#include <cctype> 
#include <cstdio> 
#include <string> 
#include <vector> 
#include <cassert> 
#include <cstdlib> 
#include <cstring> 
#include <sstream> 
#include <iostream> 
#include <algorithm> 
using namespace std; 
int main() 

//  freopen("in.txt","r",stdin); 
    int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v; 
    int a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1; 
    int z[4][4]; 
    char x; 
    for(i=0;i<4;i++) 
    { 
        for(j=0;j<4;j++) 
        { 
            cin>>x; 
            if(x=='+') z[i][j]=0;//关 
            else if(x=='-') z[i][j]=1;//开 
        } 
    } 
 
    int w[4][4],min=9999999; 
    for(a=0;a<=1;a++) 
    { 
        for(b=0;b<=1;b++) 
        { 
            for(c=0;c<=1;c++) 
            { 
                for(d=0;d<=1;d++) 
                { 
                    for(e=0;e<=1;e++) 
                    { 
                        for(f=0;f<=1;f++) 
                        { 
                            for(g=0;g<=1;g++) 
                            { 
                                for(h=0;h<=1;h++) 
                                { 
                                    for(i=0;i<=1;i++) 
                                    { 
                                        for(j=0;j<=1;j++) 
                                        { 
                                            for(k=0;k<=1;k++) 
                                            { 
                                                for(l=0;l<=1;l++) 
                                                { 
                                                    for(m=0;m<=1;m++) 
                                                    { 
                                                        for(n=0;n<=1;n++) 
                                                        { 
                                                            for(o=0;o<=1;o++) 
                                      &n
补充:软件开发 , C++ ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,