2016多校赛 Teacher Bo(曼哈顿距离)

</div>
 <div align=center id=rollword><marquee scrollamount=2 width=600 scrolldelay=30 onMouseOver="javascript:this.stop();" onMouseOut="javascript:this.start();"><b style="margin-right:20px"><a class="hot" href="/viewnotify.php?cid=706&id=3">1009:answer mod 10^9+7,题目中已修改,已加粗。请各位选手注意。</a></b><a href="/notification.php?cid=706">More...</a></marquee></div><div style="width:980px;padding:0;margin:0"><tr><td align=center><h1 style='color:#1A5CC8;margin-top: 20px'>Teacher Bo</h1><font face=Arial><b><span style='font-size:12px;color:green'>Time Limit: 4000/2000 MS (Java/Others)&nbsp;&nbsp;&nbsp;&nbsp;Memory Limit: 131072/131072 K (Java/Others)<br>Total Submission(s): 1532&nbsp;&nbsp;&nbsp;&nbsp;Accepted Submission(s): 593<br></span></b></font><br><br><div class=panel_title align=left>Problem Description</div><div class=panel_content> Teacher BoBo is a geography teacher in the school.One day in his class,he marked $N$ points in the map,the $i$-th point is at $(X_i,Y_i)$.He wonders,whether there is a tetrad $(A,B,C,D)(A&lt;B,C&lt;D,A\neq C or B\neq D)$ such that the manhattan distance between A and B is equal to the manhattan distance between C and D.<br><br> If there exists such tetrad,print &quot;YES&quot;,else print &quot;NO&quot;.</div><div class=panel_bottom>&nbsp;</div><br><div class=panel_title align=left>Input</div><div class=panel_content>First line, an integer $T$. There are $T$ test cases.$(T\leq 50)$<br><br> In each test case,the first line contains two intergers, N, M, means the number of points and the range of the coordinates.$(N,M\leq 10^5)$.<br><br> Next N lines, the $i$-th line shows the coordinate of the $i$-th point.$(X_i,Y_i)(0\leq X_i,Y_i\leq M)$.</div><div class=panel_bottom>&nbsp;</div><br><div class=panel_title align=left>Output</div><div class=panel_content>$T$ lines, each line is &quot;YES&quot; or &quot;NO&quot;.</div><div class=panel_bottom>&nbsp;</div><br><div class=panel_title align=left>Sample Input</div><div class=panel_content><pre><div style="word-wrap:break-word;White-space:Pre-wrap;width:inherit;font-family:Courier New,Courier,monospace;white-space:pre;">2
 3 10
 1 1
 2 2
 3 3
 4 10
 8 8
 2 3
 3 3
 4 4</div></pre></div><div class=panel_bottom>&nbsp;</div><br><div class=panel_title align=left>Sample Output</div><div class=panel_content><pre><div style="word-wrap:break-word;White-space:Pre-wrap;width:inherit;font-family:Courier New,Courier,monospace;white-space:pre;">YES
 NO</div></pre></div><div class=panel_bottom>&nbsp;</div><br><center style='font-size:15px;font-family:Arial;font-weight:bold;color:#1A5CC8'><a href='contest_statistic.php?cid=706&pid=1011'>Statistic</a>&nbsp;|&nbsp;<a href='contest_submit.php?cid=706&pid=1011'>Submit</a>&nbsp;|&nbsp;<a href='contest_listtopic.php?cid=706'>Clarifications</a>&nbsp;|&nbsp;<a href='contest_show.php?cid=706'>Back</A></center><br></td></tr></div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值