编程介的小学生 2019-12-19 21:45 采纳率: 20.5%
浏览 51

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 怎么获取下面的: glove_word2id.json和 glove_numpy.npy 这两个文件
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug