# 咕了很长时间，先把一些洛谷easy 写出来吧

P 1348

#include<iostream>

using namespace std;
int main()
{
double n1,n2;
cin>>n1>>n2;

for(int i=n1;i<=n2;i++)
if(i%4==0||i%2!=0)ans++;
cout<<ans;
return 0;
}


P1002 过河卒

6 6 3 3

6

#include<iostream>
#include<cstdio>
#define ll long long

ll a,b,n,m,f[22][22],map[23][23];//map需要开大点QwQ
//l a,b,n,m,map[23][23],f[22][22];
using namespace std;

void bj(ll x,ll y)
{
/*map[x][y]=1;
map[x-1][y-2]=1;
map[x-1][y+2]=1;
map[x-2][y-1]=1;
map[x-2][y+1]=1;
map[x+1][y-2]=1;
map[x+1][y+2]=1;
map[x+2][y+1]=1;
map[x+2][y-1]=1;*/
map[x][y]=1;
map[x-1][y-2]=1;
map[x-2][y-1]=1;
map[x-2][y+1]=1;
map[x-1][y+2]=1;
map[x+1][y-2]=1;
map[x+2][y-1]=1;
map[x+2][y+1]=1;
map[x+1][y+2]=1;

}
int main()
{
//cin>>n>>m>>c>>d;
scanf("%lld%lld%lld%lld",&n,&m,&a,&b);
bj(a,b);
f[1][0]=1;//bianjie
for(int i=1;i<=n+1;++i)
{
for(int j=1;j<=m+1;++j)
{

f[i][j]=f[i-1][j]+f[i][j-1];
if(map[i-1][j-1])  f[i][j]=0;//如果被马控制
}
}
printf("%lld",f[n+1][m+1]);//整体向右下挪一下
return 0;
}

posted @ 2019-06-05 00:25  lxlql  阅读(...)  评论(...编辑  收藏