放假之后回机房第一天,后面洛谷永久封了,第一次尝试AT
随便打打,先试试
不知道那场比赛
T1
- 题面:
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna
\(A,B,C,D\) and \(E\) from west to east, and their coordinates are \(a,b,c,d\) and \(e\), respectively.
Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than \(k\).
Determine if there exists a pair of antennas that cannot communicate directly.
Here, assume that the distance between two antennas at coordinates \(p\) and \(q (p<q)\) is \(q−p\).Constraints
\(a,b,c,d,e\) and \(k\) are integers between \(0\) and \(123\) (inclusive).
\(a<b<c<d<e\)
- 翻译:
就是问在\(ABCDE\)五个里有没有两个天线距离大于 \(k\)
- 代码:
#include<bits/stdc++.h>
#define int long long
#define maxm 0x66ccff
#define endl "/n"
int a[maxm],k,Luo[maxm];
signed main(){
for(int i=1;i<=5;i++)
std::cin>>a[i];
std::cin>>k;
if(k<(a[5]-a[1]))
std::cout<<":("
else
std::cout<<"Yay!";
}
- 备注:这怎么打了endl还会WA啊