Pipe Fitter and the Fierce Dogs

Pipe Fitter and the Fierce Dogs

[JAG Asia 2016]

理解题意之后,就是一个非常傻的DP

然后难在理解题意,理解非法状态

#include 
 
using namespace std;
const int maxn = 1e4+2;
int dp[maxn][3];
bool mp[maxn][maxn];
int main(){
    int w,h,k,n;
    scanf("%d%d%d%d",&w,&h,&k,&n);
    for(int i=1,u,v;i<=n;++i){
        scanf("%d%d",&u,&v);
        mp[v][u]=1;
    }
    int sp=(w+1)>>1;
    if(!(w&1)) --w;
    if(k=k){
        ans-=k;
        all-=k;
        all+=ans;
        printf("%d\n",all);
    }else{
        all-=k;
        printf("%d\n",max(0,all));
    }
    return 0;
}

你可能感兴趣的:(Pipe Fitter and the Fierce Dogs)