当前位置:网站首页>Code shoe set - mt2095 · zigzag jump
Code shoe set - mt2095 · zigzag jump
2022-07-24 15:57:00 【Tisfy】
Portal
Zigzag path
The time limit :1 second
Space restriction :128M
Title Description
Small brother is very cruel , They often send their teammates to some strange places . This time, , He put the zigzag path on jiejie At the foot of . because jiejie Don't want to be disturbed by your rhythm , So he chose to escape from heaven .jiejie Playing with the prince , Skill eq Continuous moves can displace x Yards away ,eq Displacement does not consume time . meanwhile ,jiejie The movement speed of is n Yards per second , The radius of the zigzag jump is r code .jiejie Your skills may be in cd,e and q Any skill in cd Can't use skill displacement . The effective time of zigzag jump is 2 second . Now he wants to know if he can escape the winding path
Input description
5 It's an integer
e:e Skill cd( by 0 Can be used when )
q:q Skill cd
x: Moving distance
n: Velocity of movement
r: radius
Data range
e、q Is a nonnegative integer ,x、r、n As a positive integer
Output description
If you can escape the output yes
Otherwise output no
Example 1
Input
0 0 500 100 700
Output
yes
I have read this question for a long time ( Maybe it's because I haven't played much LOL)
After reading the topic, it's very simple
The main idea of the topic
Ask you 2 2 2 Seconds , Can I move ≥ r \geq r ≥r Distance of .
There are two ways to move :
- Walk : It can move every second n n n rice
- teleport : It doesn't take time , Can move instantly x x x rice . But the premise is e ≤ 2 And q ≤ 2 e\leq 2 And q\leq 2 e≤2 And q≤2
Topic analysis
After reading the topic , It can be simulated directly .
Two seconds , Walking can move 2 × n 2\times n 2×n rice ,
If e ≤ 2 And q ≤ 2 e\leq 2 And q\leq 2 e≤2 And q≤2 , Then you can blink again x x x rice .
See whether the final moving distance ≥ r \geq r ≥r that will do .
AC Code
/* * @Author: LetMeFly * @Date: 2022-07-21 10:29:45 * @LastEditors: LetMeFly * @LastEditTime: 2022-07-21 10:33:26 */
#include <bits/stdc++.h>
using namespace std;
#define mem(a) memset(a, 0, sizeof(a))
#define dbg(x) cout << #x << " = " << x << endl
#define fi(i, l, r) for (int i = l; i < r; i++)
#define cd(a) scanf("%d", &a)
typedef long long ll;
int main() {
int e, q, x, n, r;
cin >> e >> q >> x >> n >> r;
r -= 2 * n;
if (e <= 2 && q <= 2)
r -= x;
if (r <= 0)
puts("yes");
else
puts("no");
return 0;
}
Although the code can be copied , But it's better to knock after understanding
Originality is not easy. , Reprint please attach Link to the original text Oh ~
Tisfy:https://letmefly.blog.csdn.net/article/details/125909920
边栏推荐
- 请问好的券商的排名?网上开户安全吗
- Simplified understanding: publish and subscribe
- Deploy ZABBIX monitoring system and email alarm mechanism in lamp architecture
- Error: pidfile (celerybeat.pid) already exists when celery starts beat
- Yolo5face: why reinvent the face detector
- Lsyncd 实时同步
- AttributeError: module ‘seaborn‘ has no attribute ‘histplot‘
- Mlx90640 infrared thermal imager temperature measurement module development notes (III)
- 有了这个机器学习画图神器,论文、博客都可以事半功倍了!
- 【着色器实现Pixelate马赛克效果_Shader效果第七篇】
猜你喜欢

iptables常用命令小清单

253 Conference Room II

JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue

Nine key measures to maintain server security in Hong Kong

Introduction to kettle messy notes

torch_ How to use scatter. Scatter() in detail

Dynamics 365: explain virtual entity from 0 to 1

You can't just focus on flex layout and elaborate animation to explain all flex layout methods! Easy to understand dry goods tutorial

Reentrantlock reentrant lock

自适应设计和响应式设计
随机推荐
Yolov4 trains its own data set
AttributeError: module ‘seaborn‘ has no attribute ‘histplot‘
MySQL write lock does not take effect
3、 Set foundation ArrayList set and simple student management system
Fine tune layoutlm V3 for bill data processing and content recognition
自适应设计和响应式设计
[acwing] 909. Chess game
降噪蓝牙耳机哪个好?性价比最高的降噪蓝牙耳机排行
【tf.keras】:版本从1.x升级到2.x遇到的一个问题:InvalidArgumentError: Cannot assign a device for operation embedding_
Hard core innovation that database needs to care about in the future
R语言可视化分面图、多变量分组嵌套多水平t检验、并指定参考水平、可视化多变量分组嵌套多水平分面箱图(faceting boxplot)并添加显著性水平、指定显著性参考水平
Power of leetcode 231.2
iptables常用命令小清单
矩阵的秩和图像的秩的一些了解
【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)
上课作业(6)——#575. 单词的划分(word)
【AdaptiveAvgPool3d】pytorch教程
Database learning – select (multi table joint query) [easy to understand]
Class assignment (6) - 575. Word division (word)
Lsyncd set up synchronous image - use lsyncd to realize real-time synchronization between local and remote servers