当前位置:网站首页>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
边栏推荐
- JUC source code learning note 3 - AQS waiting queue and cyclicbarrier, BlockingQueue
- Please talk about the financial products with a yield of more than 6%
- MySQL学习笔记(总结)
- 2.19 haas506 2.0 development tutorial - Bluetooth - Bluetooth communication (only supports versions above 2.2)
- 请问好的券商的排名?网上开户安全吗
- MySQL source code analysis -- data structure of index
- Kubernetes版本对接对象存储
- 【tf.keras】:版本从1.x升级到2.x遇到的一个问题:InvalidArgumentError: Cannot assign a device for operation embedding_
- From which dimensions can we judge the quality of code? How to have the ability to write high-quality code?
- Dynamics crm: sharing records for users and teams
猜你喜欢

After taking aiyouteng's medicine, Naifei's condition improved

Arduino IDE ESP32固件安装和升级教程

MySQL learning notes (summary)

Simplified understanding: publish and subscribe

Error: pidfile (celerybeat.pid) already exists when celery starts beat

iptables常用命令小清单

Using JS to implement click events

faster-rcnn 训练自己的数据集

Introduction to bermudagrass

狗牙根植物介绍
随机推荐
Netease email (126/163): authorization code acquisition strategy
Arduino IDE ESP32固件安装和升级教程
Kubernetes GPU's Dilemma and failure
R语言ggplot2可视化:ggplot2可视化基本散点图(scatter plot)、通过在theme_bw中指定参数base_size来改变轴标签的大小、并控制网格线和轴标签的大小
Will the capital market be optimistic about TCL's folding screen story?
【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)
Dynamics crm: how to set the order of forms
Which is a good noise reduction Bluetooth headset? Ranking of the most cost-effective noise reduction Bluetooth headsets
How to choose the appropriate data type for fields in MySQL?
R language Visual facet chart, multivariable grouping nested multilevel t-test, and specify reference level, visual multivariable grouping nested multilevel faceting boxplot, and add significance leve
[shaders realize pixelate mosaic effect _shader effect Chapter 7]
Force button 31. Next arrangement -- double finger needling
You can't just focus on flex layout and elaborate animation to explain all flex layout methods! Easy to understand dry goods tutorial
If this.$router Push the same address with different parameters, and the page does not refresh
yolov3 训练自己的数据集
Hard core innovation that database needs to care about in the future
Personal practical experience: Data Modeling "whether account data belongs to dimension or account domain"
【洛谷】P1908 逆序对
Parse string
torch_ How to use scatter. Scatter() in detail