Rescue The Princess(数学)

Windows系统监控实战:Grafana+Prometheus+node_exporter配置全攻略 本文提供了一套完整的Windows系统监控解决方案,详细介绍了如何使用Grafana、Prometheus和node_exporter(Windows版为windows_exporter)构建可视化监控平台。从环境准备、组件安装配置,到数据可视化与常见问题排查,手把手指导您实现从数据采集到仪表盘展示的全过程,帮助您从被动救火转向主动预警,有效保障Windows服务器稳定运行。 阅读详情
题目描述

Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immediately. Yet, the beast set a maze. Only if the prince find out the maze’s exit can he save the princess.
Now, here comes the problem. The maze is a dimensional plane. The beast is smart, and he hidden the princess snugly. He marked two coordinates of an equilateral triangle in the maze. The two marked coordinates are A(x1,y1) and B(x2,y2). The third coordinate C(x3,y3) is the maze’s exit. If the prince can find out the exit, he can save the princess. After the prince comes into the maze, he finds out the A(x1,y1) and B(x2,y2), but he doesn’t know where the C(x3,y3) is. The prince need your help. Can you calculate the C(x3,y3) and tell him?

输入

The first line is an integer T(1 <= T <= 100) which is the number of test cases. T test cases follow. Each test case contains two coordinates A(x1,y1) and B(x2,y2), described by four floating-point numbers x1, y1, x2, y2 ( |x1|, |y1|, |x2|, |y2| <= 1000.0).
Please notice that A(x1,y1) and B(x2,y2) and C(x3,y3) are in an anticlockwise direction from the equilateral triangle. And coordinates A(x1,y1) and B(x2,y2) are given by anticlockwise.

输出

For each test case, you should output the coordinate of C(x3,y3), the result should be rounded to 2 decimal places in a line.

样例输入
4
-100.00 0.00 0.00 0.00
0.00 0.00 0.00 100.00
0.00 0.00 100.00 100.00
1.00 0.00 1.866 0.50
样例输出
(-50.00,86.60)
(-86.60,50.00)
(-36.60,136.60)
(1.00,1.00)
思路

平面上一点 ( x1 , y1) , 绕平面上另一点( x2 , y2 )顺时针旋转θ角度 ,旋转后的( x1 , y1)对应的坐标( x ,y )
x = ( x1 - x2 ) * cosθ - ( y1 - y2 ) * sinθ + x2;
y = ( y1 - y2 ) * cosθ + ( x1 - x2 ) * sinθ + y2;

代码
#include<iostream>
#include<string>
#include<map>
#include<set>
//#include<unordered_map>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<cmath>
#include<fstream>
#define X first
#define Y second
#define best 131 
#define INF 0x3f3f3f3f
#define P pair<int,int>
#define ls p<<1
#define rs p<<1|1
//#define int long long
//#define int long long
//const ll lnf=0x3f3f3f3f3f3f3f3f;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const double eps=1e-5;
const double pai=acos(-1.0);
const int N=2e5+10;
const int maxn=1e6+10;
const int mod=1000000007;
int main( )
{
    double tmp=sqrt(3);
    int t;
    scanf("%d",&t);
    while(t--)
    {
        double x1,x2,y1,y2,x,y;
        scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
        x=x2-x1;
        y=y2-y1;
        double x3=x/2-y*tmp/2+x1;
        double y3=y/2+x*tmp/2+y1;
        printf("(%.2f,%.2f)\n",x3,y3);
    }
    return 0;
}

最后附上大佬的公式证明:https://www.cnblogs.com/fangsmile/p/8622421.html

从硬件拆解到图像生成:一次搞懂MRI设备(主磁体、梯度线圈、射频系统)是如何协同工作的 本文深入解析MRI设备的三大核心系统——主磁体、梯度线圈和射频系统如何协同工作,实现从量子现象到诊断图像的转化。通过详细的技术参数和临床案例,揭示磁共振成像(MRI)在医疗图像处理中的精密工程原理和最新技术突破,帮助读者全面理解这一现代医学影像技术的运作机制。 阅读详情

相关推荐

报错:subprocess.CalledProcessError: Command ‘[‘where‘, ‘cl‘]‘ returned non-zero exit status 1.

右键此电脑--属性--高级系统设置--环境变量--系统变量--找到Path。Enterprise是企业版,如果你是社区版就找Community。2.安装的时候,c++桌面那个需要勾选。

2301_77554343的博客 1507

Rescue The Princess

Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immediately. Yet, the b

zyq_19960204的博客 400

Debian 11 下用hostapd+dnsmasq搭建WiFi热点:从命令行到实战(避坑指南)

本文详细介绍了在Debian 11系统上,使用hostapd和dnsmasq从命令行搭建稳定WiFi热点的完整实战流程。内容涵盖环境准备、无线网卡AP模式检查、服务深度配置,并重点提供了从服务启动失败到客户端无法上网等常见问题的系统性排错指南,帮助用户避开配置陷阱,成功创建可用的无线接入点。

CAT789的专栏 772

Vanguard Online Qalian Lore Overview about People

This is Qalian Lore about people overview in Vanguard online. After you read that, hoping you will get help from that. Just enjoy that... Taniris the son of a merchant who has resided in Khal fo

poogyou的专栏 1811

不到200块!手把手教你用ZYNQ7010和AD9363攒一台自己的开源SDR硬件(附BOM清单)

本文详细介绍了如何用不到200元的预算,基于ZYNQ7010 FPGA和AD9363射频芯片打造一台功能完备的开源SDR硬件平台。从核心组件选型、PCB设计到焊接调试,提供全流程实战指南,特别适合预算有限的硬件爱好者和创客群体探索无线通信世界。

weixin_26854829的博客 479

DexProtector内存态匿名段检测绕过与dex重组技术

Dex文件是Android应用的核心执行单元,其结构规范(如header_item、class_def_item、code_item)决定了运行时加载与解析的底层逻辑。DexProtector通过将dex数据拆解为多个无文件名、受保护的内存匿名段(如[anon:dp_header]、[anon:dp_code]),规避传统基于文件特征或标准加载路径的检测机制。该策略依赖Android mmap内存管理与ART虚拟机对dex结构的刚性要求,形成可被观测的布局规律。理解其内存态组织原理,结合权限/大小/命名/内

weixin_30855761的博客 688

山东省第四届acm.Rescue The Princess(数学推导)

Rescue The Princess Time Limit: 1 SecMemory Limit: 128 MB Submit: 412Solved: 168 [Submit][Status][Web Board] Description Several days ago, a beast caught a beautiful princess and the princess...

weixin_30698297的博客 216

RAP 语义键:让 UUID 世界变得可读、可导航、可校验

RAP 语义键的核心价值与实现要点 语义键(Semantic Key)是 ABAP RAP 模型中连接技术实现与业务体验的关键设计:通过为实体指定一组业务可读的标识字段(如订单号、物料编码等),在保持技术主键(如UUID)不变的同时,显著提升用户界面的可读性和导航体验。 主要优势: 提升UI可读性:Fiori元素会突出显示语义键字段,帮助用户快速识别关键业务数据 改善导航体验:OData URL会使用可读的语义键而非技术ID,便于分享和排查问题 降低沟通成本:业务人员能准确引用有意义的业务标识而非技术ID

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 153

【ZOJ 4097-Rescue the Princess】无向图tarjan缩点+LCA

链接 ZOJ 4097-Rescue the Princess 题意 给你一个无向图(不一定联通),有q次查询,每次查询给出三个点u,v,w,问v和w是否可以到达u而且不经过相同的边。 做法 首先我们把整个无向图进行缩点,可以得到一棵森林,如果答案合法,那么u,v,w肯定要在一棵树上,而且v和w的LCA一定是u,但是这里要注意这时无根树,所以要加一些判断,对所有不合法情况判断即可。 代码 #inc...

lajiyuan的博客 1002

YOLOv8改进系列:RepVGG重参数化结构——训练多分支,推理单路,极致提速

本文将详细介绍如何将RepVGG的重参数化思想融入到YOLOv8的骨干网络中,实现一种训练时多分支、推理时单路的改进版YOLOv8。我们将提供完整的代码实现、详细的原理讲解,并在COCO数据集和自定义数据集上进行充分的实验验证。

YOLO 200

深入浅出讲解外部服务提供者 OAuth 2.0 帐户客户端创建与 ABAP 系统集成

本文详细介绍了在SAP ABAP平台配置OAuth 2.0客户端以安全调用外部Web服务的完整流程。主要内容包括:首先需要在外部服务提供者平台注册OAuth客户端,获取client ID和client secret;其次需特别注意重定向URI必须是公开可访问的地址;然后在ABAP系统中通过事务码OA2C_CONFIG配置OAuth客户端信息;最后阐述了常见的错误排查方法。文章强调了OAuth 2.0作为SAP系统与外部服务安全集成的标准协议,正确配置客户端是确保后续API调用安全可靠的关键前提。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1734

Rescue The Princess(数学)

题意:为有一个等边三角形给出了两个点的坐标A(x1,y1),B(x2,y2),让你求C(x3,y3)的坐标,且A,B,C按逆时针排列; 开始想运用等边三角形的特有性质列两个方程解出C的坐标,emmm发现并不能行 然后真正的解题思路为按角来求 先求出AB这条边与x轴所成的夹角的sin(a),cos(a); 然后在求AC这条边与x所成夹角的值极为sin(a+60度),cos(a+60度) 解出这两个之...

zjf的博客 287

【图像去噪】论文精读:Restormer: Efficient Transformer for High-Resolution Image Restoration

论文题目:Restormer: Efficient Transformer for High-Resolution Image Restoration —— Restormer:用于高分辨率图像恢复的高效变压器高效Transformer模型用于图像恢复!由于卷积神经网络 (CNN) 在从大规模数据中学习可泛化的图像先验方面表现良好,因此这些模型已广泛应用于图像恢复和相关任务。最近,另一类神经架构 Transformer 在自然语言和高级视觉任务中显示出显着的性能提升。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 1524

Rescue The Princess (数学水题)

Rescue The Princess

806

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

VC中sqlite的使用

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

山东省第四届ACM省赛 A SDUT 2603 Rescue The Princess(简单数学题)

Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     Several days ago, a beast caught a beautiful princess and the princess was put in prison. To

Code_KK的博客 587

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

山东省第四届ACM程序设计竞赛A题:Rescue The Princess(数学+计算几何)

Rescue The Princess Time Limit: 1 SecMemory Limit: 128 MBSubmit: 412Solved: 168[Submit][Status][Web Board] Description Several days ago, a beast caught a beautiful princess and the princes...

weixin_30466421的博客 151

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

SDUT 2603 Rescue The Princess

Rescue The Princess Time Limit: 1000ms Memory limit: 65536K有疑问?点这里^_^ 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue t...

anvt77205的博客 128

rescue the princess 省赛四1

Rescue The Princess Time Limit: 1000MS Memory limit: 65536K 题目描述     Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a

a716121的专栏 435

问题 A: Rescue The Princess

问题 A: Rescue The Princess 时间限制: 1 Sec 内存限制: 128 MB 题目描述 Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immediately. Yet, the beast set a

菜瓜变菜鸟 244

第四届 Rescue The Princess

DescriptionSeveral days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry  the princess set out immediately. Yet, the be

Misdom_Tian_Ya的专栏 583

山东省赛A题:Rescue The Princess

http://acm.sdibt.edu.cn/JudgeOnline/problem.php?id=3230 Description Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who w

ACM!荣耀之路! 2903

山东省第四届 A Rescue The Princess

题目描述     Several days ago, a beast caught a beautiful princess and the princess was put in prison. To rescue the princess, a prince who wanted to marry the princess set out immediately. Yet, th

不想宅的冷同学 955

SDUT 2603-Rescue The Princess(几何题)

Rescue The Princess Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述     Several days ago, a beast caught a beautiful princess and the princess was put in prison. To

Rocky0429 1068
上一篇: 【模板】可持久化线段树 2(主席树)
下一篇: Boring Counting(主席树+二分)
Cosmic_Tree
博客等级 码龄7年 134粉丝 337原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值