1 solutions

  • 2
    @ 2025-7-19 19:36:08
    #include<bits/stdc++.h>
    using namespace std;
    typedef long long LL;
    int dx[]={-2,-2,-1,-1,1,1,2,2};
    int dy[]={-1,1,-2,2,-2,2,-1,1};
    int main()
    {
    	LL x1,y1,x2,y2;
    	cin>>x1>>y1>>x2>>y2;
    	int cnt=0;
    	for(int i=0;i<8;i++)
    	{
    		int a=x1+dx[i],b=y1+dy[i];
    		int dx=a-x2,dy=b-y2;
    		int s=dx*dx+dy*dy;
    		if(s==5)
    		{
    			cnt++;
    		}
    	}
    	if(cnt>0)
    	{
    		cout<<"Yes";
    	}
    	else
    	{
    		cout<<"No";
    	}
    	return 0;
    }
    
    • @ 2026-1-2 11:31:27

      变量名错了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    • @ 2026-1-2 11:31:51

      @ int dx=a-x2,dy=b-y2;

      确实,这错了
      
  • 1

Information

ID
2464
Time
1000ms
Memory
256MiB
Difficulty
1
Tags
# Submissions
14
Accepted
6
Uploaded By