uva_10250 - The Other Two Trees

使用vite+react+ts+Ant Design开发后台管理项目(四) 本文将引导开发者从零基础开始,运用、react、react-router、react-redux、Ant Design、less、tailwindcss、axios等前沿技术栈,构建一个高效、响应式的后台管理系统。通过详细的步骤和实践指导,文章旨在为开发者揭示如何利用这些技术工具,从项目构思到最终实现的全过程,提供清晰的开发思路和实用的技术应用技巧。使用vite+react+ts+Ant Design开发后台管理项目(一)使用vite+react+ts+Ant Design开发后台管理项目(二) 阅读详情

Problem E

The Other Two Trees

Input: standard input

Output: standard output

Time Limit: 2 seconds

 

You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, that means you have a common fence with all of them. For example if you have a fence of length d in one side, this fence of length d is also the fence of the adjacent neighbor on that side. The adjacent neighbors have no fence in common among themselves and their lands also don’t intersect. The main difference between their land and your land is that their lands are all square shaped. All your neighbors have a tree at the center of their lands. Given the Cartesian coordinates of trees of two opposite neighbors, you will have to find the Cartesian coordinates of the other two trees.

 

Input

The input file contains several lines of input. Each line contains four floating point or integer numbers x1, y1, x2, y2, where (x1, y1), (x2, y2) are the coordinates of the trees of two opposite neighbors. Input is terminated by end of file.

 

Output

For each line of input produce one line of output which contains the line “Impossible.” without the quotes, if you cannot determine the coordinates of the other two trees. Otherwise, print four floating point numbers separated by a single space with ten digits after the decimal point ax1, ay1, ax2, ay2, where (ax1, ay1)  and (ax2, ay2) are the coordinates of the other two trees. The output will be checked with special judge program, so don’t worry about the ordering of the points or small precision errors. The sample output will make it clear.

 

Sample Input

10 0 -10 0

10 0 -10 0

10 0 -10 0

 

Sample Output

0.0000000000 10.0000000000 0.0000000000 -10.0000000000

0.0000000000 10.0000000000 -0.0000000000 -10.0000000000

0.0000000000 -10.0000000000 0.0000000000 10.0000000000


     以平行四边形的四个边向外做四个正方形,这四个正方形的中心点围成正方形,证明略。。。然后知道两个顶点坐标先求出中心点坐标,再用向量就可以很快求出

    刚开始用float wa了,精度不够,改成double后ac

  

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
    double x1, y1, x2, y2;
    while ( cin >> x1 >> y1 >> x2 >> y2){
        double cx = ( x1+x2)/2, cy = ( y1+y2)/2;
        
        double vx = x1 - cx, vy = y1 - cy;
        cout << fixed << setprecision(10);
        cout << cx - vy << " " << cy + vx << " " << cx + vy << " " << cy - vx <<endl;

    }
    return 0;
}

WSL2双显卡配置实战:避开Tesla与TCC模式的那些坑 本文针对WSL2环境下无法识别Tesla计算卡的问题进行深度解析。核心原因在于WSL2目前仅支持WDDM模式的显卡,而Tesla系列及运行在TCC模式下的显卡因采用纯计算架构而无法兼容。文章提供了详细的排查步骤,并给出了包括调整显卡用途、使用虚拟机或物理机在内的多种实用解决方案,帮助开发者避开配置陷阱。 阅读详情

相关推荐

Python异步协程爬虫优化:解决aiohttp中ServerDisconnectedError的高效策略

本文深入探讨了在Python异步协程爬虫中使用aiohttp时,如何高效解决常见的ServerDisconnectedError问题。核心策略包括全局复用ClientSession、精细配置TCPConnector连接池、实施请求重试与速率限制,从而构建稳定、高效的异步爬虫架构,有效避免服务器断开连接错误。

pz890123的博客 859

uva 10250 - The Other Two Trees

Problem E The Other Two Trees Input: standard input Output: standard output Time Limit: 2 seconds   You have a quadrilateral shaped land whose opposite fences are of equal length. You have four

coco430的专栏 498

LabVIEW工程密码保护机制与移除技术详解

LabVIEW作为工业自动化领域广泛使用的图形化编程工具,其密码保护机制涉及文件加密与权限控制等核心技术。从技术实现来看,现代版本采用AES-128加密结合SHA-256哈希校验,而经典版本使用XOR加密配合Base64编码。理解这些加密原理对于工程维护、灾难恢复等合法场景至关重要。在实际应用中,密码移除工具需要处理不同版本的文件结构差异,包括解析XML描述区的Protection标签、动态识别版本并应用对应解密策略。这类技术在工业设备维护、教学研究等场景具有重要价值,但必须注意遵守法律边界,确保拥有合法的

weixin_34161083的博客 390

UVa 10250 - The Other Two Trees

题意是给出两个点的坐标, 求以他们的连线为斜边的正方形的另外两个顶点坐标.

一只冰熊 858

零基础实战:用 Docker 和 vLLM 本地部署 bge-reranker-v2-m3 重排序模型

本文介绍了如何利用Docker容器和vLLM推理框架在本地部署BAAI开发的bge-reranker-v2-m3文本排序模型。

举世誉之而不加劝,举世非之而不加沮,定乎内外之分,辩乎荣辱之境,斯已矣。 5972

YOLOv11改进 | 添加注意力篇 | 一文带你改进GAM、CBAM、CA、ECA等通道注意力机制和多头注意力机制

这篇文章给大家带来的改进机制是一个汇总篇,包含一些简单的注意力机制,本来一直不想发这些内容的(网上教程太多了,发出来增加文章数量也没什么意义),但是群内的读者很多都问我这些机制所以单独出一期视频来汇总一些比较简单的注意力机制添加的方法和使用教程,本文的内容不会过度的去解释原理,更多的是从从代码的使用上和实用的角度出发去写这篇教程。欢迎大家订阅我的专栏一起学习YOLO!YOLOv11改进系列专栏——本专栏持续复习各种顶会内容——科研必备目录一、本文介绍二、GAM2.1 GAM的介绍2.2 GAM的核心代码。

Snu77的博客 5154

UVA10250 The Other Two Trees【旋转坐标系】

You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, that means you have a common fence with al...

海岛Blog 466

AD9361功能介绍和使用

AD9361使用分数分频锁相环(PLL)来产生发射机和接收机本地振荡器(LO)频率和BB PLL。BB PLL 可用于数据转换、数字滤波器和 |/O 端口。PLL的参考时钟可以由外部振荡器或外部晶体(XO)和数字可编程片内可变电容提供,电容微调产生参考时钟频率,XO和微调电容的组合统称为DCXO。有多个天线输入的分集系统。接收链数据首先经过低噪声放大器(LNA),然后是同相(1)和正交(Q)放大器,混频器和频带整形滤波器,可将接收到的信号下变频为基带以进行数字化。时分双工(TDD)和频分双工(FDD)。。。

wangjie36的博客 1万+

UVA - 10250 The Other Two Trees

题目大意:给出两棵树的位置找到另外两棵,四点构成正方形。 构成正方形证明:侵删。UVa 10250 The Other Two Trees by 我叫空格_ 解题思路:求出中点,把所给的两棵树的坐标绕中点旋转 90 度得到的坐标就是另外两棵。 (x, y) 绕 (0, 0) 顺时针转90度后坐标为 (y, -x) (x, y) 绕 (p, q) 顺时针转90度: 先把 (p, q) 移到

life kicks in right now 233

RandLA-Net Tensorrt 推理 c++

RandLA-Net 实现 Tensorrt 部署.

J。 1109

小米15修复“NV损坏” 去除主板校验电阻步骤解析与图示

小米15系列将搭载骁龙8至尊版处理器,采用台积电3nm工艺。文章分析了手机出现"NV损坏"故障的表现及修复方法,包括通信异常、系统启动问题等典型症状,并介绍了去除主板校验电阻和刷写工程固件两种修复方案。重点讲解了去除主板电阻后刷写QCN文件的操作流程,强调在维修过程中需要结合分析与思考。适用于小米15系列特定机型(24129PN74G/I/C)的硬件修复。

小马哥的专栏 313

UVA - 10250 - The Other Two Trees (简单计算几何)

UVA - 10250 The Other Two Trees Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %llu Submit Status Description Problem E The Other Two Trees Input: st

Never say never 881

FPGA电路设计1——芯片原理图和封装制作流程

本文详细介绍了FPGA电路板设计的学习过程,以Xilinx Kintex-7系列FPGA为例。主要内容包括:1)从官网下载芯片引脚分配文件的方法;2)原理图库绘制流程,重点讲解Bank划分(配置Bank、HR/HP IO Bank、高速收发器Bank)及利用Excel预处理数据;3)使用Altium Designer的Symbol Wizard工具实现引脚自动化导入;4)原理图设计要点,包括电源系统设计(多电压需求与上电时序)、配置电路(JTAG/Flash接口)和时钟设计。

在读研究生,FPGA电路设计与功能开发。 1385

UVA-10250 The Other Two Trees

2016-08-12 UVA - 10250 The Other Two Trees 题目大意:给出两棵树的位置找到另外两棵,四点构成正方形。 解题思路:求出中点,把所给的两棵树的坐标绕中点旋转 90 度得到的坐标就是另外两棵。 (x, y) 绕 (0, 0) 顺时针转90度后坐标为 (y, -x); (x, y) 绕 (p, q) 顺时针转90度; 先把 (p,

振丿Love 368

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

uva10250 The Other Two Trees

题意:给出正方形的一对点,然后求出另外两个点的坐标。 // #pragma comment(linker, "/STACK:1024000000,1024000000") #include #include #include #include #include #include #include #include #include #include #include #in

KIJamesQi的博客 394

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

UVa 10250 The Other Two Trees

还是读了很长时间的题,不过题本身很简单。 keyi

u014491224的专栏 974

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

UVA 10250-The Other Two Trees

UVA 10250-The Other Two Trees题目大意:其实就是告诉正方形对点的坐标,求出另外俩个点解题思路:向量垂直且相等即可推出#include <stdio.h> #include <iostream> using namespace std; int main() { double x1, x2, y1, y2, x3, x4, y3, y4, x0, y0; w

ZeroLH00的博客 323

uva-10250-The Other Two Trees

这道题目做完了,UVA训练计划的第一单元作玩了,继续作第二单元。 这道题目已经积压很长事件了,原因是怎么也读不懂题意,所以没法下手。 今天又看了一遍,想了想,还是硬做吧,结果对了。。。 就是两条互相垂直平分的线段,已知一条线段的两端,求另外一条线段的两点; #include #include #include int main() { double sin,cos,l; d

青竹梦 1597

UVA 10250 The Other Two Trees

#include #include int main() { double x1, y1, x2, y2; double x3, y3, x4, y4; double a, b; while (scanf("%lf%lf%lf%lf", &x1, &y1, &x2, &y2) != EOF) { if (fabs(x1 - x2) < 1e-8 && fabs(y1 - y2)

Bingo 1757

UVA10250  The Other Two Trees

Problem E The Other Two Trees Input: standard input Output: standard output Time Limit: 2 seconds   You have a quadrilateral shapedland whose opposite fences are of equal length. You have four n

潜水的程序猿 599

Uva 10250 The Other Two Trees

题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1191 题意:有一个平行四边形然后分别以四条边为边长向外作正方形,四棵树在四个正方形中心的位置。其实四棵树构成正方形,相当于给出正方形的对角线的两个点,求另外两个。 证明正方形如下:来

Keaper的博客 510

UVA 10250 The Other Two Trees

The Other Two Trees Input: standard input Output: standard output Time Limit: 2 seconds   You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors w

Remilia's 777

UVa10250 – The Other Two Trees

Special Judge   You have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, that means you have a

浮躁的人,终究一事无成! 854
上一篇: uva_408 - Uniform Generator
下一篇: uva_375 - Inscribed Circles and Isosceles Triangles
HuanTongH
博客等级 码龄12年 7粉丝 110原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值