update logic using tutorial
This commit is contained in:
parent
2b89ccf866
commit
28ffe7cbfc
@ -9,13 +9,14 @@ void solve()
|
|||||||
cin>>n>>m>>k;
|
cin>>n>>m>>k;
|
||||||
int x,y;
|
int x,y;
|
||||||
cin>>x>>y;
|
cin>>x>>y;
|
||||||
|
int vika_color=(x+y)%2;
|
||||||
bool caught=false;
|
bool caught=false;
|
||||||
while(k--)
|
while(k--)
|
||||||
{
|
{
|
||||||
int p,q;
|
int p,q;
|
||||||
cin>>p>>q;
|
cin>>p>>q;
|
||||||
int d=abs(x-p)+abs(y-q);
|
int friend_color=(p+q)%2;
|
||||||
if(d%2==0)
|
if(vika_color==friend_color)
|
||||||
{
|
{
|
||||||
caught=true;
|
caught=true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user