湖南大学ACM程序设计新生杯大赛(同步赛)J - Piglet treasure hunt Series 2

原题链接:https://www.nowcoder.com/acm/contest/55/J

bitset水水过,手写的压位倒是炸了

#include 
#include 
#include 
#include 
using namespace std;
const int MAXN=3e3+1;
typedef struct Node{
    int x,y;
}Node;
bitset  a[MAXN];
int row,col;
char str[MAXN];
int dirx[4]={0,0,-1,1};
int diry[4]={1,-1,0,0};
inline int trans(char x){
    if(x<='9'&&x>='0') return x-'0';
    return 10+x-'A';
}
queue  que;
int main(){
    while(scanf("%d %d",&row,&col)){
        getchar();
        if(row==0) break;
        int tot=0;
        for(int i=0;i=0;k--){
                    if(num%2) a[i].set(j*4+k),tot++;
                    else a[i].reset(j*4+k);
                    num/=2;
                }
            }
        }
        col*=4;
        int ans=0;
        for(int i=0;i=0&&nowy>=0&&nowxans) ans=anst;
                    tot-=anst;
                    if(tot<=ans) break;
                }
            }
        }
        printf("%d\n",ans);
    }
}

你可能感兴趣的:(湖南大学ACM程序设计新生杯大赛(同步赛)J - Piglet treasure hunt Series 2)