hdu5317 RGCDQ(15多校第三场1002)(大暴力)

//hdu 5317
//预处理+暴力
#include
#include
using namespace::std;

typedef long long LL;
const int N = 1000005;

int F[N],num[N][10];
void init(){
    F[0]=F[1]=0;
    for(int i=2;i1){
                ans=i;
            }
        }
        if(ans!=0)   printf("%d\n",ans);
        else if((B[2]>0&&B[4]>0)||(B[2]>0&&B[6]>0)||(B[6]>0&&B[4]>0))
            printf("2\n");
        else if(B[3]>0&&B[6]>0)printf("3\n");
        else printf("1\n");
    }
    return 0;
}

你可能感兴趣的:(15多校)