2 条题解
-
1
202502gj19俞快 (230923cj) LV 9 @ 2025-03-21 19:56:20
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a,b,c,d,t;
signed main()
{
cin>>a>>b>>c>>d>>t;
int minjl=abs(a-c)+abs(b-d);
if(t<minjl)
cout<<"N"<<endl;
else if((t-minjl)%2==0)
cout<<"Y"<<endl;
else cout<<"N"<<endl;
return 0;
} -
02022-08-23 13:44:06@
#include<bits/stdc++.h> using namespace std; int jdz(int x,int y) { int sum=x-y; if(sum<0) return -sum; else return sum; } int main() { int s=0,a,b,c,d,k; cin>>a>>b>>c>>d>>k; s=jdz(a,c)+jdz(b,d); if(k%2!=s%2||k<s) cout<<"N"; else cout<<"Y"; return 0; }
- 1
信息
- ID
- 1702
- 难度
- 2
- 分类
- (无)
- 标签
- 递交数
- 69
- 已通过
- 38
- 通过率
- 55%
- 被复制
- 2
- 上传者