hiho week 101 register

Ended

Participants:397

Verdict:Accepted
Score:100 / 100
Submitted:2016-06-10 19:08:37

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<bitset>
#include<cstring>
#define MAXN 105
using namespace std;
int n,m;
bitset<MAXN>rolcolList[MAXN];
bitset<MAXN>colrolList[MAXN];
bitset<MAXN>colremain;
bitset<MAXN>rolremain;
bool Dfs(int index)
{
    //if we have found the answer or there is no rol to choose
    //return the result
    if(colremain.count() == m)return true;
    else if(rolremain.count() == n)return false;
    int i,j;
    bitset<MAXN>recordrol;
    bitset<MAXN>recordcol;
    recordcol = colremain;
    recordrol = rolremain;
    for(i=index;i<=n;i++){
        //search for the available row
        if(rolremain[i] == 0){
            for(j=1;j<=m;j++){
                if(rolcolList[i][j] == 1)rolremain |= colrolList[j];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX