Codeforces Round #195 (Div. 2) / 336A Vasily the Bear and Triangle(模拟&数学)

大型国有银行应用系统全链路性能劣化智能根因定位与自愈Agent平台详细设计方案.docx 立即下载

A. Vasily the Bear and Triangle
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Vasily the bear has a favorite rectangle, it has one vertex at point (0, 0), and the opposite vertex at point (x, y). Of course, the sides of Vasya's favorite rectangle are parallel to the coordinate axes.

Vasya also loves triangles, if the triangles have one vertex at point B = (0, 0). That's why today he asks you to find two points A = (x1, y1) and C = (x2, y2), such that the following conditions hold:

  • the coordinates of points: x1, x2, y1, y2 are integers. Besides, the following inequation holds: x1 < x2;
  • the triangle formed by point A, B and C is rectangular and isosceles ( is right);
  • all points of the favorite rectangle are located inside or on the border of triangle ABC;
  • the area of triangle ABC is as small as possible.

Help the bear, find the required points. It is not so hard to proof that these points are unique.

Input

The first line contains two integers x, y ( - 109 ≤ x, y ≤ 109, x ≠ 0, y ≠ 0).

Output

Print in the single line four integers x1, y1, x2, y2 — the coordinates of the required points.

Sample test(s)
input
10 5
output
0 15 15 0
input
-10 5
output
-15 0 0 15
Note

Figure to the first sample



简单模拟。


完整代码:

/*30ms,0KB*/

#include<cstdio>

int main()
{
	int x, y;
	scanf("%d%d", &x, &y);
	if (x > 0 && y > 0)
		printf("0 %d %d 0", x + y, x + y);
	else if (x > 0 && y < 0)
		printf("0 %d %d 0", y - x, x - y);
	else if (x < 0 && y > 0)
		printf("%d 0 0 %d", x - y, y - x);
	else
		printf("%d 0 0 %d", x + y, x + y);
}



【深度学习开发环境配置】基于PyTorch的计算机视觉项目依赖管理:requirements.txt文件解析与版本控制方案 内容概要:该文件为一个Python项目的依赖包配置文件(requirements.txt),列出了项目运行所需的软件包及其最低版本要求。主要包括深度学习框架PyTorch及其视觉扩展 torchvision、科学计算库 numpy 和 scipy、数据处理工具 pandas、机器学习库 scikit-learn、图像处理库 opencv-python 和 Pillow,以及数据可视化工具 matplotlib 和 seaborn 等。该配置确保项目在不同环境中具备一致的运行条件。; 适合人群:从事深度学习、计算机视觉或数据科学相关工作的开发者与研究人员,熟悉Python环境管理的技术人员; 使用场景及目标:①用于搭建项目开发环境,确保依赖一致性;②支持模型训练、图像处理、数据分析等任务的环境准备;③便于项目共享与部署,降低环境配置成本; 阅读建议:在实际使用时,建议通过 pip install -r requirements.txt 安装依赖,并根据具体硬件环境适当调整版本兼容性,尤其注意 PyTorch 与 CUDA 版本的匹配。 立即下载

相关推荐

顶刊复现改进优化反演控制的水面舰艇自适应跟踪控制程序

内容概要:本文档介绍了名为&ldquo;【顶刊复现】改进优化反演控制的水面舰艇自适应跟踪控制程序&rdquo;的Matlab仿真资源,聚焦于水面舰艇与无人船在复杂海洋环境下的高精度路径跟踪与运动控制问题。该资源基于先进的非线性控制理论,如反演控制(Backstepping)、李雅普诺夫稳定性理论和自适应控制方法,构建了具备强鲁棒性和抗干扰能力的控制器,能够有效应对模型不确定性、外部扰动及环境变化。文档还列举了多项相关Matlab仿真项目,涵盖多智能体协同控制、事件触发通信、模糊PID控制、模型预测控制(NMPC)、滑模控制等多种前沿控制策略,充分体现了其在智能船舶控制、海洋工程自动化和无人系统领域的高水平学术价值与实际应用潜力。; 适合人群:具备自动控制理论基础和Matlab编程能力的科研人员、控制科学与工程及相关专业的研究生,以及从事无人船、水面航行器、水下机器人等智能航海装备控制系统开发的工程技术人员。; 使用场景及目标:① 复现顶级期刊(如SCI一区)中关于水面舰艇或无人船的先进控制算法,支撑高水平学术论文的研究与撰写;② 作为高校课程或科研实验的教学案例,开展非线性系统控制、自适应控制、轨迹跟踪等方向的教学与实践;③ 为智能船舶、海上无人集群系统等实际工程项目提供算法验证、性能测试与仿真优化的技术平台。; 阅读建议:此资源以Matlab代码为核心载体,建议使用者结合现代控制理论教材与原始参考文献,深入理解反演控制与自适应机制的设计逻辑与数学推导,并通过修改参数、调整初始条件和扰动设置等方式调试仿真程序,全面掌握算法的实现细节与性能边界,实现从理论分析到仿真实践的完整闭环。

Codeforces Round #195 (Div. 2) A Vasily the Bear and Triangle

A. Vasily the Bear and Triangle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasily the bear has a favori

jjaw2013 1118

网络攻防技术——MD5碰撞试验

一、题目 本次实验主要是加深大家对MD5碰撞及其原理的理解,使用SEED实验环境中的工具及编程语言,完成以下任务: a)使用md5collgen生成两个MD5值相同的文件,并利用bless十六进制编辑器查看输出的两个文件,描述你观察到的情况; b)参考Lab3_task2.c的代码,生成两个MD5值相同但输出不同的两个可执行文件。 c)参考Lab3_task3.c的代码,生成两个MD5值相同但代码行为不相同的可执行文件。 d)回答问题:通过上面的实验,请解释为什么可以做到不同行为的两个可执行文件具有相同的M

学习记录 3627

Round #195(Div.2)A、Vasily the Bear and Triangle

1、刚开始因为没有注意到x1 #include using namespace std; int main() { int x,y,x1,y1,x2,y2,tempx,tempy,ans; while(scanf("%d%d",&x,&y)==2){ if(x0)tempx=-x; else tempx=x; if(y0

236

CycloneDDS(C++版本)开源代码在Linux(X86平台)系统上编译生成可执行文件的详细步骤

cyclonedds里面已经有现成的实例供我们参考,在根目录下的example目录下面,我们打开此目录,此目录下有CMakeLists.txt文件以及一些其他的文档,我们需要在此目录(example目录)下编译构建出。我们可以看到cyclonedds-cxx-master包下的example目录下有很多文件,包括CMakeLists.txt等,其中我们要构建的可执行文件所需要的源文件等就在。此过程会稍微慢一点。之后会报错,如下:(图片中是c版本出现的问题截图,不影响,c++也是这个影响,问题是一样的)

qq_42595610的博客 1252

《手把手教你YOLOv9实战》,改进专栏目录

为了提供友好的操作效果,本专栏将会手把手搭建可视化界面,我将用PyQt5 搭建一个可视化界面,可视化界面能够实现基本的图像加载与检测功能,如支持视频、摄像头,还支持更换不同的 YOLOv9 模型,并适应不同领域(如口罩检测系统、人脸检测系统、工业缺陷检测系统等),界面灵活、功能强大。通过YOLOv9加以改进设计,形成新的算法框架,一起水科研和论文,专栏会一直持续更新中,本专栏适合目标检测、分割、分类。

在职AI算法工程师,擅长计算机视觉,YOLO目标检测、分割等,擅长web、pyqt界面可视化,好内容持续更新中,来这里跟大家一起学习,共同进步 2169

Manacher 算法详解:O(n) 复杂度求最长回文子串

先预处理下:在每个字符的两边都插入一个特殊的符号,比如abba变成#a#b#b#a#,aba变成#a#b#a#(因为Manacher算法只能处理奇数长度的字符串)。同时,为了避免数组越界,在字符串开头添加另一特殊符号,比如$#a#b#a#。 以字符串3212343219为例,处理后变成S[] = "$#3#2#1#2#3#4#3#2#1#9#"。 然后用一个数组Len[i]来记录以字符S[i

AC,∑ndless 4611

知识图谱-KGE-语义匹配-双线性模型-2018:SimplE

【paper】 SimplE Embedding for Link Prediction in Knowledge Graphs 【简介】 本文是加拿大英属哥伦比亚大学的两位学者发表在 NIPS 2018 上的工作,文章提出了 SimplE(Simple Embedding)。这篇和前面一篇差不多,也是对 1927 年的 CP 进行改进(简化),传统CP为实体分配的两个向量是独立训练的,SimplE利用关系的逆在三元组打分函数中加上了一个对称项,使得每个实体的两个向量依赖学习,并且 SimplE 的复杂度随

u013250861的博客 966

Codeforces Round #119 (Div. 2) / 189A Cut Ribbon (完全背包)

A. Cut Ribbon http://codeforces.com/problemset/problem/189/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2676

Kubeflow系统性学习教程:从入门到高级实践

Kubeflow学习教程摘要(150字): Kubeflow是基于Kubernetes的云原生MLOps平台,提供端到端机器学习解决方案。核心功能包括Jupyter Notebooks开发环境、Pipelines工作流编排、分布式训练支持和模型服务部署。教程采用三阶段学习路径:初学者搭建Kind集群体验Notebooks;中级开发自定义Pipeline组件;高级实现企业级应用。通过容器化和K8s CRD深度集成,解决环境一致性、实验跟踪和资源调度等MLOps痛点,相比MLflow/Airflow更适合大规模

自可乐的博客 895

基于Simulink进行光伏逆变器效率分析的仿真建模

特点能量转换:将光伏电池板产生的直流电转换为交流电。效率评估:分析逆变器在不同负载条件和环境条件下的效率。动态特性:考虑温度、光照强度等外部因素对逆变器效率的影响。挑战精确建模:准确地模拟光伏电池板、逆变器及其交互的动力学过程。多因素考量:需要同时考虑输入电压、电流、温度、光照强度等多种因素对逆变器效率的影响。集成度:需要与其他系统(如最大功率点跟踪MPPT算法、电网连接等)无缝集成,以实现全面的系统分析。首先明确要模拟的任务内容。输入条件(如光照强度、温度等)。

amy_mhd的博客 144

Codeforces Round #105 (Div. 2) / 148A Insomnia cure (枚举 || 数论)

A. Insomnia cure http://codeforces.com/problemset/problem/148/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2453

【AI智能体】Codex 实现OpenClaw 开源项目二次开发实战详解

【AI智能体】Codex 实现OpenClaw 开源项目二次开发实战详解

congge 1656

Codeforces Beta Round #74 (Div. 2) / 90B African Crossword (模拟)

B. African Crossword http://codeforces.com/problemset/problem/90%2FB time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

AC,∑ndless 2417

端到端自动驾驶的精准测试场景开发

1. 背景介绍 自动驾驶技术的发展正在改变交通运输的未来,然而,要实现安全可靠的自动驾驶,需要进行大量的测试和验证。端到端自动驾驶系统的测试场景开发是实现这一目标的关键。本文将详细介绍端到端自动驾驶的精准测试场景开发,包括核心概念、算法原理、数学模型、项目实践,以及未来发展趋势。 2. 核心概念与联系

AGI×大数据,开启智能时代的认知跃迁;解码AGI,赋能数据驱动的智能革命。 1322

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Codeforces Round #173 (Div. 2) / 282A Bit++(模拟)

A. Bit++ http://codeforces.com/problemset/problem/282/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 2231

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Codeforces Round #235 (Div. 2) / 410D Roman and Numbers (带有整除性质的数位DP)

http://codeforces.com/problemset/problem/401/D 解释全部在代码的注释中: /*78ms,205464KB*/ #include using namespace std; const int mx = 1 << 18; long long dp[mx][100]; ///dp[mask][j]表示余数为j时的mask对应的x的个数 ///

AC,∑ndless 2199

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Codeforces Round #194 (Div. 1) / 333A Secrets(贪心)

A. Secrets http://codeforces.com/contest/333/problem/A time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ge

AC,∑ndless 2041

Codeforces Beta Round #98 (Div. 2) / 137A Postcards and photos (模拟)

A. Postcards and photos http://codeforces.com/problemset/problem/137/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

AC,∑ndless 2023

Codeforces Round #177 (Div. 1) / 288A Polo the Penguin and Strings(贪心)

A. Polo the Penguin and Strings http://codeforces.com/problemset/problem/288/A time limit per test 2 seconds memory limit per test 256 megabytes input standard input output

AC,∑ndless 1934

Codeforces Beta Round #75 (Div. 2) / 92B Binary Number(贪心)

B. Binary Number http://codeforces.com/problemset/problem/92/B time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1932

Codeforces Round #183 (Div. 1) / 303A Lucky Permutation Triple (强大的数学&想法题)

http://codeforces.com/problemset/problem/303/A when n is odd, A[i] = B[i] = i when n is even, there is no solution. why? If , then  or just , where S = 0 + 1 + ... + n - 1 = n(n - 1) / 

AC,∑ndless 1916

Codeforces Round #237 (Div. 2) / 404C Restore Graph (构造最短路径树)

http://codeforces.com/contest/404/problem/C 思路:我们构造一颗最短路径树就行了。 若能够构造,边数必然为n-1(样例1的边数可以是两条)。 如何构造?从距离为1的点开始,逐渐往下加边,生成一颗k叉树。若在中间生成了大于k的叉,则输出-1。 完整代码: /*265ms,4436KB*/ #include using namesp

AC,∑ndless 1840

Codeforces Round #186 (Div. 2) / 313B Ilya and Queries (字符串处理)

B. Ilya and Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ilya the Lion wants to help all his fri

AC,∑ndless 1810

【优化&大师级代码欣赏】Codeforces Round #137 (Div. 2) / 222B Cosmic Tables (矩阵)

B. Cosmic Tables http://codeforces.com/problemset/problem/222/B time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output

AC,∑ndless 1782

Codeforces Round #218 (Div. 2) / 371B Fox Dividing Cheese (想法题)

http://codeforces.com/contest/371/problem/B 神题必有神解——你能想到这么做吗? /*15ms,0KB*/ #include using namespace std; int op_cnt[6]; int main() { int a, b, ans = 0; cin >> a >> b; for (int n = 2; n <=

AC,∑ndless 1696
上一篇: Codeforces ABBYY Cup 3.0 / 316A1 316A2 Special Task(模拟&贪心&组合数学)
下一篇: Codeforces Round #177 (Div. 1) / 288A Polo the Penguin and Strings(贪心)
synapse7
博客等级 码龄14年 432粉丝 701原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值