AutoX安途杯中山大学程序设计校赛(同步赛)
比赛链接
AutoX安途杯中山大学程序设计校赛(同步赛)
C.Lucky Matrix
题目描述
A is a Lucky Matrix if and only if are all integers and .
For example, these are Lucky Matrices:
However, these are NOT Lucky Matrices: (Pay attention that in a Lucky Matrix all the 9 numbers must be integers.)
Now you are given the three integers in the matrix, and you need to determine the values of such that the matrix is a Lucky Matrix.
输入描述:
The first line of input contains an integer , denoting the number of test cases.
Each test case contains three integers in one line. .
输出描述:
For each test case, print 6 integers in one line, denoting your answer.
If there is no solution, print "-1". If there are multiple solutions, you can print any one of them.
输入
输出
解题思路
数学
设 ,则 ,由 ,即 ,得 ,又有 ,得 ,故有:,解得
- 时间复杂度:
代码
D.Determinant
题目描述
HZ is doing homework. The answer to a problem is a matrix. After trying for several hours, he finally solved it. But unfortunately, one of the four numbers in the matrix is replaced by by accident. Besides the three remaining numbers, he only remembers that the determinant of the matrix is bigger than zero. Now your task is to compute the range of .
输入描述:
The first line of input contains an integer , denoting the number of test cases.
Each test case contains four elements , denoting the matrix . One of the elements is replaced by xx while the remaining three are integers.
. (This is the range of the three given integers, not the range of . can be any real number.)
输出描述:
For each test case, print your answer in one line:
If the range of is all real numbers, print "R";
If the range of is empty set, print "E";
Otherwise, print "x>p/q" or "x<p/q" (, and qq are coprime). Specially, if , you should only print "x>p" or "x<p".
输入
输出
解题思路
二阶行列式即正对角线的乘积减去副对角线的乘积,模拟一遍即可,关键在于找 的字符串的处理~
- 时间复杂度:
代码
E.Sequence I
题目描述
You are given a sequence of length . Each time you can delete two adjacent numbers, and insert the absolute value of their difference in the corresponding position. What is the mininum number you can get after operations? (The number you get means the only one integer left after operations.)
输入描述:
The first line of input contains an integer , denoting the number of test cases.
Each test case contains two lines:
The first line contains one integer , denoting the length of the sequence;
The second line contains integers , denoting the sequence.
输出描述:
For each test case, print one integer in one line, denoting your answer.
输入
输出
解题思路
暴力dfs
数据量较小,可暴力dfs
,即每次操作枚举任意一个数进行操作,再输出多出来的数与插入新数~
- 时间复杂度:
代码
__EOF__

本文链接:https://www.cnblogs.com/zyyun/p/15415707.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角【推荐】一下。您的鼓励是博主的最大动力!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战