编程介的小学生 2017-12-07 16:30 采纳率: 20.5%
浏览 642
已采纳

The troubles of lmy

Problem Description
Lmy is the lovely cousin of zmq, and she’s a junior high school student. One day she came back from school.
Zmq: What did you learn in your class today?
Lmy: Similar triangle.
Zmq: Well, fine, have you mastered it?
Lmy: Sure, that’s a piece of cake.
Zmq: OK, well, let me test you to see whether you have thoroughly understood the conception of being similar. I’ll draw two Arbitrary Polygons, and you have to tell me whether they are similar or not. If you are right, I’ll take you out.
Lmy: ……
It seems that little lmy got into troubles. Can you help her out by designing a program?

Input
There are several test cases in the input.
The first line of each case is an n (n <= 300), indicating that each polygon has n points. And in the following 2n lines, each line represents a point. The first n point represents the first polygon in anti-clockwise order, and so the second. Please note that all the polygons are simple.
You can try to rotate them, then tell whether they are similar or not.

Output
For each case, output “Yes” or “No”, showing whether they are similar.

Sample Input
3
0 0
1 1
0 1
0 0
2 2
0 2
3
0 0
1 1
0 1
0 0
2 2
0 1

Sample Output
Yes
No

  • 写回答

1条回答 默认 最新

  • threenewbee 2018-02-18 15:28
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64