主页
试题仓库
题目列表
试题分类
经典教材
作业竞赛
作业列表
判题队列
图灵学院
TuringMOOC
图灵书屋
图灵商城
图灵实验室
图灵会员
荣誉成绩
捐赠支持
图灵云编译器
用户/排名
AOJ排名
实名认证
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem 3820 --Pty plays game
3820: Pty plays game
上一题
正确率: $0.00\%$
下一题
Time Limit
$5$ 秒/Second(s)
Memory Limit
$128$ 兆字节/Megabyte(s)
提交总数
$0$
正确数量
$0$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
单击选择分类:
Description
<span style="font-family:"font-size:16px;">Pty is playing a game, where he is leading a team of soldiers. He is facing a challenge in the game. He plans to complete the challenge x days later. </span><br /> <br /> <span style="font-family:"font-size:16px;">The monster is also leading a team of soldiers. And to complete the challenge Pty should beat these soldiers. </span><br /> <br /> <span style="font-family:"font-size:16px;">The battle will execute as follows. At first, the first soldier of both teams will fight first. When a soldier’s hit points becomes 0,the soldier will be replaced by the next soldier in the same team.A team is considered a victory only if there is any soldier alive but nobody is alive in the opposite team finally. </span><br /> <br /> <span style="font-family:"font-size:16px;">The soldier x have </span><span class="MathJax_Preview" style="color:#888888;font-family:"font-size:14px;"></span><span style="font-size:16px;">hx</span><span style="font-family:"font-size:16px;"> hit points and can cause </span><span class="MathJax_Preview" style="color:#888888;font-family:"font-size:14px;"></span><span style="font-size:16px;">dx</span><span style="font-family:"font-size:16px;"> damage to the enemy per second. Notice that the seconds of a fight may not be an integer. </span><br /> <br /> <span style="font-family:"font-size:16px;">Both Pty and the monster will train their soldiers continuously, so the hit points and damage per second of all the soldiers will increase every day. </span><br /> <br /> <span style="font-family:"font-size:16px;">Pty wants to know the minimum x that he will complete the challenge if it take place on x days later.</span><br /> <br /> <span style="font-family:"font-size:16px;">If Pty can’t win the monster in </span><span class="MathJax_Preview" style="color:#888888;font-family:"font-size:14px;"></span><span style="font-size:16px;">10<sup>18</sup></span><span style="font-family:"font-size:16px;"> days, please print none . Specially, if Pty can win now, the answer is 0.</span><span style="font-size:16px;"></span>
Input
<span style="font-family:"font-size:16px;">An integer T in the first line, it is the number of tesecases. And there are T cases later.</span><br /> <br /> <span style="font-family:"font-size:16px;">In each case, two integers in the first line n,m, which is the numbers of soldiers in the Pty’s team and the monster’s team. </span><br /> <br /> <span style="font-family:"font-size:16px;">In the next n lines, each line contains 4 integers. They means the hit point, the increment of hit point every day, the damage and the increment of damage every day. </span><br /> <br /> <span style="font-family:"font-size:16px;">In the next m lines, also contains 4 integers. They are the information of the soldier in the monster’s team. </span><br /> <br /> <span class="MathJax_Preview" style="color:#888888;font-family:"font-size:14px;"></span><span style="font-size:16px;">(1≤n,m≤10<sup>5</sup>,∑(n+m)≤2×10<sup>6</sup>,0≤hx,dx≤10<sup>6</sup>,0≤increment≤10<sup>3</sup>)</span>
Output
<span style="font-family:"font-size:16px;">For each test case, output ’none’ or integer means the minimum of x in one line.</span><span style="font-size:16px;"></span>
Sample Input
2 3 2 2 3 1 3 3 2 4 3 1 2 2 3 3 3 4 2 4 1 1 3 1 1 1 1 1 1 1 1 1 1
Sample Output
1 none
推荐代码
查看3820 所有题解
上传题解视频得图灵币
本题记录
用 户(点击查看用户)
运行号(点击购买题解)
时 间
算法最快[$0 $ms]
0
内存最少[$0 $KB]
0
第一AC
0
第一挑战
0
赛题来源
登录后提交代码
题面与样例可直接查看,登录后即可在线提交和评测。
前往登录