版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、题目来源Ural 1509 Domino Recognition问题描述一块 1*2 的骨牌(每个 1*1 的骨牌边长在区间1,100内),可有数字 0 到 6。刻法如下:输入两块骨牌上 n 个点的坐标(1n12),输出所有可能的骨牌数值。(确保存在合法的分布)算法计算所有两点点对的距离,求出最大值和最小值的比即可确定。n=2 和 n=7 的情况需要单独处理。算法证明模拟算法,无需证明。算法实现没有实现上。源代码const maxn=12;zero=1e-4;var dd,max,min:extended;i,j,k,n:long;d,rray1.maxn,1.maxnof extended;
2、x,y:array1.maxnof extended; beginreadln(n);for i:=1 to n for i:=1 to nfor j:=1 todo readln(xi,yi); don dodi,j:=(sqr(xi-xj)+sqr(yi-yj); max:=d1,2; min:=d1,2;for i:=1 to n-1 dofor j:=i+1 to ndo beginthen max:=di,j;hen min:=di,j;if if end;case ndi,jmaxdi,jmof1:begin wri2:beginn(0 1); halt; end;if d1,2+
3、zero5000+zero then begin wri wrin(0 2);wrin(1 1); halt;end;3:beginn(11); halt; end;if ififabs(d1,2-d2,3)zeroabs(d1,3-d2,3)zeroabs(d1,2-d1,3)zerothen thenthenbegin beginbeginwri wriwrin(0n(0n(03);3);3);halt; end; halt; end;halt; end;wrin(1 2); halt;end; 4:beginif maxmin*4then wrin(0 4)/sqrt(2)else if
4、 maxmin*10then wri else wrihalt; end;5:beginn(2n(12)/ sqrt(5)3); / sqrt(13)if maxmin*4.5then wrin(0 5)/2else if maxmin*8then wri else wrihalt; end;6:beginif maxmin*12n(1n(24)3);/sqrt(13/2)sqrt(20)then if maxmin*9then wrielse wrin(0n(26)4)/sqrt(8)sqrt(10)else if maxmin*23 then begin wri else begink:=
5、0;for i:=1n(1n(35)3);/sqrt(13)sqrt(20)n(1 6); halt; endto n-1 dofor j:=i+1 to n doif di,jmin*30n(3 4) else wrin(25);then wrin(2 6)/sqrt(40)else if maxmin*15then wri else wrihalt; end;9:beginif maxmin*30n(3n(45)4);/sqrt(20)sqrt(10)then wri else wri halt;end;10:beginn(4n(35)6);/sqrt(20)/ sqrt(40)if ma
6、xmin*30then wrin(5 5)/ sqrt(20)else wri halt;end; 11:begin wri 12:begin wri end;end.n(4 6);/ sqrt(40)n(5 6); halt;n(6 6); halt;end;end;原题描述:1509. Domino RecognitionTime Limit: 1.0 second Memory Limit: 16 MBIn Vovans casino, all croupiers are robots. Once a thought occurred toVovant it would be usefu
7、l if robotst play dominoes with cntscould recognize the type of a bone before it is turned over,t is, whena bones on a table with its face down. Fortunay, it issiblesince the dots on bones are diamonds, and diamonds can be seen in X-rays. Moving a manipulator over a bone, a robot can direct X-rays t
8、hrough itto a camera locatedhe robots leg. Using the obtained photo, a spelprogram must recognize the type of the bone. Now try to guess who will write this program.A bone is a rectangle of size L 2L (1 L 100) comed of two squares.In each of the squares, there are from 0 to 6 dots arrangedhe classic
9、alway. In order to describe the arrangements of dots on a square, we considera smaller square with the same center whose sides are twi the sides of the bigger square and parallel to them.hortern1 dot is puthe center of the square2 dots are situated at the lower left and upper right corners of the sm
10、allersquare 3 dots of the 4 dots5 dots of the(we ameta bone is oriented vertically) he same way as 2 dots plus a doare arranged squareare at the four are arranged squarethe centercorners of the smaller square he same way as 4 dots plus a dothe center6 dots: four dots are puthe corners of the smaller
11、square and two t are paralleldots are at the middles of the sides of the smaller square to the long sides of the bone.Your task is toyze a photo of a bone. It is knownt the photo showsall dots of exactly one bone. The plane of the parallel to the tablerface; there are no distortions, but the bone ma
12、y be arbitrarily rocameras receiver isor otheredhe plane of thetable.t fett the bone on the tableis turned over.InputThe 12).line contains the number of dots seenhe photo N (1 NThe next N lines contahe coordinates of these dots. Thecoordinates are accurate to 0.0001. Absolute values of coordinates exceed 2000. The photo shows the real size of the bone.otOutputegers A and B (A B), which are the numbers of dotsOutputhetwo squares of the bone. If several answers aresible, they should begiven correct.he lexicograph
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年当前最受欢迎的绿色建筑材料清单及应用领域解析
- 遨游学海益处多演讲稿
- 2026年单招动物医学综合知识题库
- 2026年制造业单项冠军培育知识竞赛题
- 文化馆岗位练兵演讲稿
- 科技馆参观演讲稿
- 2026年学习成长中的常见问题解
- 2026年音乐理论与音乐欣赏试题
- 足球比赛前激情演讲稿
- 2026年教师课堂言行及纪律要求测试题
- 危险化学品名录
- 有限空间监理实施细则
- 钣金厂规划方案
- 智慧树知到《新媒体概论(浙江传媒学院)》章节测试答案
- 201年报考中国民航飞行学院硕士研究生政审表
- JT-T-1209-2018公路工程SBS改性沥青加工设备技术要求
- JBT 9229-2024 剪叉式升降工作平台(正式版)
- 心脏介入手术谈话技巧
- 腾讯会议录制培训课件
- 法律顾问服务投标方案(完整技术标)
- 《电气控制与PLC》考试复习题库(含答案)
评论
0/150
提交评论