HDU 6581 Vacation——————2019多校第一场,思维

HDU 6581 Vacation 思维或者二分答案 HDU 6581 Vacation 题目链接 题目大意:Tom所处的车是0号车,道路是单行道,不能超车,Tom前面有n辆车,每辆车都有l, s, v三种属性,分别代表车长,车头距离终点线的距离,车的最大速度。当一辆车没有追上前面的车时,这辆车以最大速度行驶,当追上前车时(前车车尾和这俩车车头距终点线距离相等),这辆车以前车的速度继续行驶。所有车子过了终点线后仍然会行驶,求Tom的车到终点线(车... 阅读详情

Vacation

Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 1060 Accepted Submission(s): 420
Special Judge

Problem Description
Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them. The ith car has a length of li, the head of it is si from the stop-line, and its maximum velocity is vi. The car Tom and Jerry are driving is l0 in length, and s0 from the stop-line, with a maximum velocity of v0.
The traffic light has a very long cycle. You can assume that it is always green light. However, since the road is too narrow, no car can get ahead of other cars. Even if your speed can be greater than the car in front of you, you still can only drive at the same speed as the anterior car. But when not affected by the car ahead, the driver will drive at the maximum speed. You can assume that every driver here is very good at driving, so that the distance of adjacent cars can be kept to be 0.
Though Tom and Jerry know that they can pass the stop-line during green light, they still want to know the minimum time they need to pass the stop-line. We say a car passes the stop-line once the head of the car passes it.
Please notice that even after a car passes the stop-line, it still runs on the road, and cannot be overtaken.

Input
This problem contains multiple test cases.
For each test case, the first line contains an integer n (1≤n≤105,∑n≤2×106), the number of cars.
The next three lines each contains n+1 integers, li,si,vi (1≤si,vi,li≤109). It’s guaranteed that si≥si+1+li+1,∀i∈[0,n−1]

Output
For each test case, output one line containing the answer. Your answer will be accepted if its absolute or relative error does not exceed 10−6.
Formally, let your answer be a, and the jury’s answer is b. Your answer is considered correct if |a−b|max(1,|b|)≤10−6.
The answer is guaranteed to exist.

Sample Input
1
2 2
7 1
2 1
2
1 2 2
10 7 1
6 2 1

Sample Output
3.5000000000
5.0000000000


题意:
Tom和Jerry的车是0号车
Tom和Jerry的车前面还有n辆车
每一辆车都有它的车身长度   l i \ l_i  li​,距离终点的距离 s i s_i si​,车的速度 v i v_i vi​

这条路是单车道,后面的车不能超过前面的车
后面的车如果贴到了前面的车尾上,那么就会和前面的车以共同的速度前行

问0号车通过终点需要花费的时间
问0号车通过终点是指0号车车头通过终点

思维:

当0号车通过终点的时候,它的前面肯定有 k ( 0 ≤ k ≤ n ) k(0\le k\le n) k(0≤k≤n)辆车
当0号车通过终点的时候,如果它的前面有0辆车和它贴着,那么它的通过时间就是 s 0 / v 0 s_0 / v_0 s0​/v0​
当0号车通过终点的时候,如果它的前面有1辆车和它贴着,那么它的通过时间就是 ( s 1 + l 1 ) / v 1 (s_1 + l_1 )/ v_1 (s1​+l1​)/v1​

因为1号车前面没有车和它紧贴着,所以1号车通过终点的时间是 s 1 / v 1 s_1/v_1 s1​/v1​,而在1号车通过终点后,0号车也要通过终点,此时它的速度也是 v 1 v_1 v1​,它要以 v 1 v_1 v1​的速度通过 l 1 l_1 l1​的距离,所以0号车通过终点的时间是 ( s 1 + l 1 ) / v 1 (s_1 + l_1 )/ v_1 (s1​+l1​)/v1​

当0号车通过终点的时候,如果它的前面有2辆车和它贴着,那么它的通过时间就是 ( s 2 + l 1 + l 2 ) / v 2 (s_2 + l_1+l_2 )/ v_2 (s2​+l1​+l2​)/v2​
在这里插入图片描述

我们只需要找出通过实践最大的那个就好了


//#include<bits/stdc++.h>
#include<cstdio>
#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<bitset>
#include<set>
#include<vector>


using namespace std;
typedef long long ll;
typedef pair<int ,int> P;

const int INF  = 0x3f3f3f3f;
const int MAXN = 2e5+7;
double l[MAXN], s[MAXN], v[MAXN];

double Max(double a,double b){
        return a>b?a:b;
}

int main(){
        // freopen("../in.txt","r",stdin);
        // freopen("../out.txt","w",stdout);

        int n;
        while(~scanf("%d",&n)){
                n++;
                for(int i=0;i<n;++i)
                        scanf("%lf",&l[i]);
                for(int i=0;i<n;++i)
                        scanf("%lf",&s[i]);
                for(int i=0;i<n;++i)
                        scanf("%lf",&v[i]);
                double ans = -1.0;
                double len = 0.0;
                for(int i=0;i<n;++i){
                        if(i>0) len += l[i];
                        ans = Max(ans, (len+s[i])/v[i]);
                        // cout<<len<<" "<<len+s[i]<<" "<<v[i]<<" "<<ans<<endl;
                }
                printf("%.10lf\n", ans);
        }
        return 0;
}

ATAC-seq差异分析实战:从原始数据到GO富集(R/Bioconductor全流程) 本文提供了ATAC-seq差异分析的完整R/Bioconductor实战流程,涵盖从原始数据准备、一致峰集构建、计数矩阵生成,到使用DESeq2进行差异可及性分析,以及差异峰的基因组注释与GO富集分析。文章详细讲解了关键步骤、参数设置和常见问题,旨在帮助研究者获得可靠且可解释的生物学结果。 阅读详情

相关推荐

避开RK3588开发板SDIO配置的坑:O9201SB WiFi模组接入实战指南

本文为嵌入式开发者提供了在RK3588开发板上,利用TF卡槽接入O9201SB WiFi6模组的实战指南。文章深度剖析了SDIO配置中常见的电源管理序列冲突问题,并给出了从设备树节点修改、内核编译到系统验证的完整解决方案,帮助开发者避开配置陷阱,成功实现高性能无线连接。

sprite的博客 954

2019杭电多校第一场

1004 Vacation(HDU 6581) 链接:HDU 6581 /***************************** 杭电多校第一场 1004 Vacation 题目大意:在一个有信号灯的路口,在你的车前面有n辆车在停车等待,现在每个车给出车身长度, 最大速度,以及车头到停止线的长度,求你的车最快在多少秒之后可以通过路口 解题思路:我们可以让每个车去跟自己的车单独比较,...

Starbucks 1110

从时序精度到视觉盛宴:PY32F030驱动WS2812的工程艺术与避坑指南

本文深入探讨了基于PY32F030微控制器驱动WS2812智能LED的完整解决方案。通过精确的时序控制、硬件PWM结合DMA传输技术,实现了稳定可靠的驱动效果,并提供了电源管理、信号完整性和常见问题排查等实用避坑指南,帮助开发者轻松应对严格的纳秒级时序挑战。

wind6的博客 120

hdu6581 2019杭电多校第一场 Vacation

现场队友二分过了,后来看dls讲课以后,发现O(n)做法非常简单自然 我们考虑最终的情况,要么前面没有一辆车堵住tom,那么tom直接满速到终点 如果前面某一辆车堵住了tom,那么最终情况是,从那辆车到tom全部连在一起,那辆车越过终点l[1]+l[2]...l[id]。 总距离就是sum[id]+s[id],因为是这辆车堵住了,所以这辆车速度是从id到0中最慢的,这辆车到达那个位置的总时间...

binarycopycode 418

CMake是什么?为什么学习CMake

CMake的主要作用和重要性,包括其在跨平台构建中的应用、如何支持多种编译器及操作系统,以及它在管理大型和复杂项目中的优势。

小鱼酱的博客 3872

【一 扣子客户案例合集】【 1.1 抖音电商:通过扣子智能体重塑电商服务新体验】

**摘要:**抖音电商借助扣子(Coze)智能体平台重塑客服体验,通过无代码开发、多模态交互和跨平台发布等功能,解决了传统客服高峰期压力大、成本高及响应机械等痛点。智能体采用直接面客与人工监管结合模式,实现高效精准服务,并通过解构流程、模块化设计优化系统架构。其技术优势包括零配置学习、意图识别、情绪感知等,实际应用中显著提升客服效率300%以上,改善用户体验。未来将进一步拓展至商品推荐、直播互动等场景,推动电商服务智能化升级。

商务合作|问题讨论|交流学习 请联系作者微信,加微信请务必注明来意,博客主页有联系方式 1570

2019年杭电多校第一场 Vacation HDU - 6581 (思维)

题目链接:https://cn.vjudge.net/problem/HDU-6581 题意:给你n+1辆车,在一条狭窄的路上行驶,每辆车都有三个属性,l[i],s[i],v[i], l[i]:代表车长 s[i]:代表车头到停止线的距离 v[i]:代表速度 车在前进的时候如果前面有车,并且车的速度比它小,那么就会追上并且黏在一起成为一辆车。 给你的车的标号依次为, 车在窄路上的分布...

zx93的博客 321

第11节:GPU 线程层级:线程、线程块、网格

层级标识变量功能线程threadIdx执行单元,处理数据线程块blockIdx管理多个线程,提供共享内存网格管理多个 blockGPU 编程中,合理安排线程层级,是提升性能的关键。

yumeiguo的博客 211

HDU 6581-Vacation【二分答案和O(n) 做法】

Problem Description Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there arencars in front of them. Theit...

独钓门前月 642

一台NAS两个系统:飞牛nas上完美运行群晖DSM?(飞牛nas+群晖nas套娃安装实操)

想在飞牛NAS上体验群晖DSM系统?💡 本文详细记录了飞牛nas上部署群晖的完整过程,从镜像转换到系统安装,每一步都有详细说明 🖥️,让你在不增加硬件成本的情况下,轻松实现一套硬件、多种系统的灵活部署 ✅

XiaoqiangClub的博客 2370

Unity DOTS核心概念之 System(系统)

本文全面解析Unity ECS架构中System的核心概念与最佳实践。System作为纯逻辑载体,遵循"查询数据→处理数据"的工作流,严格分离数据与逻辑。文章详细介绍了: System定义方式(推荐ISystem接口)与三大设计准则(纯逻辑、无状态、最小权限) 生命周期管理(OnCreate/OnUpdate/OnDestroy)和执行顺序控制(UpdateInGroup/UpdateBefore) 实体查询机制(SystemAPI.Query高级筛选)和多线程优化(IJobEntity

分享知识,拥抱变化 183

2019 数列有序!

                                      数列有序!<br />                                       Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)<br />                                       Total Submission(s): 12842    Accepted S

依然spurs 1418

Python 爬虫实战:爬取豆瓣电影 Top250 完整数据

本文基于Python技术实现了豆瓣电影Top250榜单数据的合规爬取与分析。针对豆瓣电影页面的分页结构、反爬机制等特点,采用requests库获取数据,结合BeautifulSoup解析HTML节点,并通过正则表达式提取电影名称、评分、导演等核心字段。爬虫实现了随机User-Agent、请求间隔控制等反爬规避策略,严格遵守豆瓣社区使用规范。最终数据经清洗后存储为结构化Excel文件,并提供了数据可视化与增量更新方案。该方案为影视研究提供了可靠的数据获取方法,同时确保符合非商业使用、适度爬取等合规要求。

2503_91057718的博客 3460

2019多校第一场 HDU6581 - Vacation(思维)

链接:HDU6581 - Vacation 题意: 一排车过停止线,给出车的长度 l ,车头到停止线的距离 s,车的最高速度 v 。每辆车都以最高速度v行驶,但是若和前车间距为0时,速度无法超过前车(即会与前车保持一致速度)。 现TOM的车(标号为0)前方有n辆车(标号为1 ~ n)。问TOM最少要多久才能到达停止线? 注意:即使车过了停止线也仍然在路上(即会阻碍到后面的车) 分析: 看了题解...

Plus Ultra! 329

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

【2019杭电多校第一场1004=HDU6581】Vacation(思维+避免超时)

题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题目: Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others) Problem Description Tom and Jerry are going on a vaca...

Cassie_zkq的博客 348

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

杭电2019多校第一场 HDU——6581 Vacation (思维)

时间限制: 1 Sec内存限制: 128 MBSpecial Judge 题目描述 Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n ca...

lgz0921的博客 298

精雕软件(JDpaint) 5.5 绿色版

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

【HDU 6581】[2019 HDU 多校第一场] Vacation (思维,枚举)

题目 Problem Description Tom and Jerry are going on a vacation. They are now driving on a one-way road and several cars are in front of them. To be more specific, there are n cars in front of them. The ...

t14 的博客 190

HDU-6581 Vacation(思维题)2019暑假杭电多校第一场

题意:汤姆和杰瑞要去度假。他们现在在一条单行道上行驶,前面有几辆车。更具体地说,他们前面有n辆车。第i辆车的长度为l[i],车头距停车线为s[i],最大速度为v[i]。汤姆和杰瑞驾驶的车的长度为l[0],距停车线为s[0],最大速度为v[0]。然而,由于道路太窄,没有一辆车能比其他车领先。即使你的速度比前面的车快,你仍然只能以和前面的车一样的速度行驶。但如果不受前方车辆的影响,驾驶员将以最大速度行...

ayyyyy_zc的博客 294

HDU6581 Vacation (HDU2019多校第一场1004)

HDU6581 Vacation (HDU2019多校第一场1004) 传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6581 题意: 给你n+1辆汽车,每辆汽车有汽车的长度L,汽车距离终点的距离S,汽车的最大速度V 汽车与汽车之间距离为0时,速度大的汽车的速度会等于速度小的汽车的速度 求离终点最远的那辆车的车头到达终点的时间 注意,当汽车驶过终点线后...

buerdepepeqi的优快云博客 215

2019杭电多校 第一场 6581-Vacation【思维】

2019杭电多校 第一场 6581-Vacation【思维】 题目:http://acm.hdu.edu.cn/showproblem.php?pid=6581 参考资料: https://www.cnblogs.com/wawcac-blog/p/11229277.html https://www.cnblogs.com/Satan666/p/11273615.html 大致题意: 共有n+1辆...

weixin_43334251的博客 238

2019暑假杭电多校赛第一场D.Vacation(思维)

Vacation 传送门:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1004&cid=848 Problem Description Tom and Jerry are going on a vacation. They are now driving on a one-way road and several c...

Slime 535

2019 hdu多校第一场 D.Vacation

hdu 6581Vacation 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6581 O(n)直接贴代码了 #include<bits/stdc++.h> using namespace std; long long s[100005],l[100005],v[100005]; int main(){ long ...

sinat_41719390的博客 173

HDU 6581 Vacation

HDU 6581 Vacation Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K(Java/Others) Total Submission(s): 2173 Accepted Submission(s): 966Special Judge Problem Descriptio...

qq_44866969的博客 140

2019杭电多校联赛第一场 D - Vacation (签到题)

2019杭电多校联赛第一场 D - Vacation (签到题) 话不多说先上题目 HDU - 6581☌ 题意 汤姆面前有n辆车,每辆车的车长为s,车到红绿灯线的距离为l,车速为v。 这个道路很窄只能通过一辆车,所以当后面的车追上前面车的时候,后面车的车速只能和前面的车速一样。 求汤姆车头到达红绿灯线的时间。 多组输入 第一行输入n,代表汤姆前面有n辆车 第二行有n+1个数据,第一个数据是汤姆车...

zhz的博客 230

HDU 2019多校联赛 1004题Vacation(HDU-6581) 思维题

6581 题目链接 题意: 有n+1辆车要过马路,信号灯一直为绿。每个车的长度为,距离停止线产长度,速度为。现在要求求出第0辆车(据停车线最远的)从开始到车头通过停止线经过的时间。每辆车可以无缝衔接。 思路: 既然可以无缝衔接,那么就让可以追上的汽车合成一个汽车,速度为前车的速度,计算整辆车(合并后的车尾)经过停止线的时间。无需考虑两车的间距,因为时间是相同的。只需找到最大的时间即可。 ...

涅槃重塑的博客 543

[HDU 6581] Vacation

题目大意: 有n+1辆车,你是排在最后的一辆,每辆车有三个参数si,vi,li,分别表示距离终点的距离,最高速度,以及车长,由于车道很窄,所以不能超车,也就是当你追上前面的车时,速度就得跟他一样,现在让我们求我们通过终点的时间。 题目链接: HDU 6581 题目分析: 实数二分时间,首先默认可以超车,算出每个车的位置,然后倒着算出每个车的实际位置,看是否能过终点,把精度放到10^-8就能过了 代...

HT008的Blog 224
上一篇: zzuli 1530 小L玩滚球游戏——————思维
下一篇: HDU 6582 Path——————2019多校第一场,最短路+最大流
陶鸿杰
博客等级 码龄9年 93粉丝 298原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值