Codeforces Round #380 (Div. 2,Based on Technocup 2017 - Elimination Round 2)C - Road to Cine//

四旋翼无人机模糊自适应PID控制,俯仰姿态控制律设计研究(Matlab代码、Simulink仿真实现) 内容概要:本文围绕四旋翼无人机的俯仰姿态控制问题,深入研究了模糊自适应PID控制律的设计与实现。通过结合模糊逻辑系统的自适应能力与传统PID控制器的稳定性,构建了一种能够在复杂动态环境中有效应对外部扰动和模型不确定性的先进控制策略。研究详细阐述了控制系统的结构设计、模糊规则库的建立、隶属度函数的选取以及PID参数的在线调整机制,并利用Matlab/Simulink工具进行了完整的建模与仿真实验,验证了所提方法在响应速度、超调量和抗干扰能力等方面相较于传统PID控制的显著优越性。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真经验的自动化、航空航天及相关专业的本科生、研究生及科研人员。; 使用场景及目标:①学习和掌握模糊自适应PID控制器的设计原理与方法;②研究无人机姿态控制算法的性能提升途径;③完成相关课程设计、毕业设计或科研项目的仿真验证工作。; 阅读建议:建议读者结合Matlab代码与Simulink模型,深入理解控制算法的实现细节,并尝试调整系统参数和仿真条件,以探究不同因素对控制性能的影响,从而达到理论与实践相结合的学习目的。 立即下载

C. Road to Cinema
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from the service to the cinema. Let's introduce a coordinate system so that the car rental service is at the point 0, and the cinema is at the point s.

There are k gas stations along the road, and at each of them you can fill a car with any amount of fuel for free! Consider that this operation doesn't take any time, i.e. is carried out instantly.

There are n cars in the rental service, i-th of them is characterized with two integers ci and vi — the price of this car rent and the capacity of its fuel tank in liters. It's not allowed to fuel a car with more fuel than its tank capacity vi. All cars are completely fueled at the car rental service.

Each of the cars can be driven in one of two speed modes: normal or accelerated. In the normal mode a car covers 1 kilometer in 2minutes, and consumes 1 liter of fuel. In the accelerated mode a car covers 1 kilometer in 1 minutes, but consumes 2 liters of fuel. The driving mode can be changed at any moment and any number of times.

Your task is to choose a car with minimum price such that Vasya can reach the cinema before the show starts, i.e. not later than in tminutes. Assume that all cars are completely fueled initially.

Input

The first line contains four positive integers n, k, s and t (1 ≤ n ≤ 2·105, 1 ≤ k ≤ 2·105, 2 ≤ s ≤ 109, 1 ≤ t ≤ 2·109) — the number of cars at the car rental service, the number of gas stations along the road, the length of the road and the time in which the film starts.

Each of the next n lines contains two positive integers ci and vi (1 ≤ ci, vi ≤ 109) — the price of the i-th car and its fuel tank capacity.

The next line contains k distinct integers g1, g2, ..., gk (1 ≤ gi ≤ s - 1) — the positions of the gas stations on the road in arbitrary order.

Output

Print the minimum rent price of an appropriate car, i.e. such car that Vasya will be able to reach the cinema before the film starts (not later than in t minutes). If there is no appropriate car, print -1.

Examples
input
3 1 8 10
10 8
5 7
11 9
3
output
10
input
2 2 10 18
10 4
20 6
5 3
output
20
Note

In the first sample, Vasya can reach the cinema in time using the first or the third cars, but it would be cheaper to choose the first one. Its price is equal to 10, and the capacity of its fuel tank is 8. Then Vasya can drive to the first gas station in the accelerated mode in 3minutes, spending 6 liters of fuel. After that he can full the tank and cover 2 kilometers in the normal mode in 4 minutes, spending 2liters of fuel. Finally, he drives in the accelerated mode covering the remaining 3 kilometers in 3 minutes and spending 6 liters of fuel.


二分1到10^9,先找到符合时间的油箱的容量的最小值,然后通过最小值来找输入的数据中,油箱符合条件(大于等于最小值)的车里,最便宜的那辆车,为什么要找最便宜的车呢,因为便宜的车稳啊(手动滑稽)。

#include<stdio.h>
#include<algorithm>
#define inf 0x3f3f3f3f3f3f3f3f
using namespace std;
long long int c[200005],v[200005],g[200005],lenn[200005];
long long int n,k,s,t;
bool judge (long long int x); 
int cmp(long long int a,long long int b)
{
	return a<b;
}
int main()
{
	long long int le,ri,mid,i;
	scanf("%lld %lld %lld %lld",&n,&k,&s,&t);
	for(int i=0;i<n;i++)
	scanf("%lld %lld",&c[i],&v[i]);
	g[0]=0;
	for(i=1;i<=k;i++)
	{
		scanf("%lld",&g[i]);
	}
	g[++k]=s;
	sort(g,g+k+1,cmp);
	for(i=1;i<=k;i++)
	{
		lenn[i-1]=g[i]-g[i-1];
	}
	//for(i=0;i<n;i++)
//	printf("%d\n",judge(v[i]));
	le=1,ri=1000000005;
	while(le<ri)
	{
		mid=(le+ri)/2;
		if(judge(mid))
		{
			ri=mid;
		}
		else
		{
			le=mid+1;
		}
	}
//	printf("%d %d %d\n",le,mid,ri);
	long long int min=inf;
	for(i=0;i<n;i++)
	{
		if(v[i]>=ri)
		{
			if(min>c[i])
			min=c[i];
		}
	}
	if(min==inf)
	printf("-1\n");
	else
	printf("%lld\n",min);
	return 0;
	
}
bool judge(long long int x)
{
	long long int cost=0;
	for(int i=0;i<k;i++)
	{
		if(lenn[i]>x)
		return 0;
		else if(lenn[i]*2<=x)
		{
			cost+=lenn[i];
		}
		else
		{
			cost+=2*lenn[i];
			cost-=(x-lenn[i]);
		}
	}
	if(cost<=t)
	return 1;
	return 0;
}





复现基于李雅普诺夫的多个欠驱动无人船协同路径跟踪Matlab仿真 内容概要:本文详细介绍了基于李雅普诺夫稳定性理论的多个欠驱动无人船协同路径跟踪控制方法的Matlab仿真研究。通过建立非线性动力学模型,设计分布式协同控制器,并利用李雅普诺夫函数严格证明系统的渐近稳定性,实现了多艘无人船在复杂海洋环境下的高精度路径跟踪与稳定编队保持。文中系统阐述了控制器的设计原理、稳定性分析过程、仿真参数配置及多种典型场景下的仿真实验结果,充分验证了该方法在提升编队协同性、抗外部干扰能力和鲁棒性方面的显著优势。; 适合人群:具备自动控制理论、非线性系统分析基础以及Matlab/Simulink仿真能力的研究生、科研人员,以及从事无人系统、船舶自动化、多智能体协同控制等领域研发工作的工程师。; 使用场景及目标:①用于多智能体系统协同控制算法的研究与教学示范;②为欠驱动船舶的路径跟踪控制、海上集群航行等实际工程应用提供可靠的算法设计思路与仿真验证平台;③支撑相关领域高水平论文撰写、科研项目申报与关键技术攻关。; 阅读建议:建议读者结合提供的Matlab代码逐模块研读,重点关注李雅普诺夫函数的构造技巧与控制器参数的整定方法,并尝试在不同环境扰动(如海流、风浪)下进行仿真实验,以深入理解系统的鲁棒性与适应性。 立即下载

相关推荐

CoppeliaSim学习笔记(1):建立Python脚本与CoppeliaSim的连接

CoppeliaSim学习笔记,建立python和CoppeliaSim的连接,实现联调。

qq_22487889的博客 1万+

CF--Technocup 2017 - Elimination Round 2(ABCDE)

真的不是模拟专场么?(大雾A题:题意:遇到ogo换成*** 后面紧接着的所有go忽略,其他字符打印出来 tip:while大法好#include <cstdio> #include <iostream> #include <cstring> using namespace std; const int maxn = 110; int n; char s[maxn]; void init(){

zjy2015302395的博客 638

GD32F303串口DMA发送数据避坑指南:为什么你的发送函数会卡住?

本文深入解析GD32F303单片机串口DMA发送数据时常见的卡死问题,提供详细的避坑指南。从DMA传输完成中断时序、发送状态管理到双通道DMA的特别注意事项,全面剖析问题根源并给出解决方案,帮助开发者构建健壮的DMA发送机制。

weixin_27038245的博客 303

Codeforces(738C)-Road to Cinema

原题链接 C. Road to Cinema time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya is currently at a car rent

L. 506

三电平逆变器LC滤波设计避坑指南:从SVPWM谐波到Simulink仿真验证

本文详细解析了三电平逆变器LC滤波设计中的关键问题,从SVPWM谐波特性到Simulink仿真验证,提供了800V/10kW系统的参数计算方法和优化技巧。通过实际案例和仿真配置示例,帮助工程师避免常见设计误区,提升电能质量和系统稳定性。

weixin_29261711的博客 177

Proteus 8.9仿真五路抢答器:从74LS148编码到NE555报警的保姆级电路拆解

本文详细解析了使用Proteus 8.9仿真五路抢答器的完整设计流程,从74LS148优先编码器到NE555定时报警电路。通过保姆级的电路拆解和芯片选型指南,帮助读者掌握数字电路中的编码、锁存、译码和定时等核心技术,实现稳定可靠的抢答系统仿真。

weixin_30836759的博客 388

Technocup 2017 - Elimination Round 2 C. Road to Cinema —— 二分

题目链接:http://codeforces.com/problemset/problem/729/C C. Road to Cinema time limit per test 1 second memory limit per test 256 megabytes input standard input ...

weixin_30633949的博客 170

修复漏洞Windows 2012 Server R2(CVE-2016-2183)、(CVE-2015-2808)、(CVE-2013-2566)

【代码】修复漏洞Windows 2012 Server R2(CVE-2016-2183)、(CVE-2015-2808)、(CVE-2013-2566)

路~可以走过 2775

Codeforces Round #382 (Div. 2)A到D题 A. Ostap and //B. Urbanization//C. Tennis Championship//D. Taxes

A. Ostap and Grasshopper time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output On the way to Rio de Janeiro Ostap

jerans的博客 1289

学Simulink--基础微电网场景实例:基于Simulink的微电网并网/孤岛无缝切换控制仿真

本文完成了基于 Simulink 的微电网并网/孤岛无缝切换控制仿真,实现了:✅ 构建含双模式逆变器的微电网模型✅ 实现预同步 + Stateflow 逻辑的智能切换✅ 验证计划与非计划切换的性能边界✅ 证明“无缝”在工程上是可实现的。

amy_mhd的博客 112

Boost.Interprocess 共享内存通信优化实战

本文探讨使用Boost.Interprocess库优化共享内存通信的方法。通过直接使用Eigen::Vector3d避免精度损失,减少数据拷贝,采用timed_send/timed_receive防止死锁,并优化序列化过程。优化后的代码显著提高了性能,特别适用于高频率数据交换场景。实验表明,这些改进能有效提升通信稳定性和传输效率。

2501_90323865的博客 98

Gym - 101128C Canvas Painting 逆向思维

https://odzkskevi.qnssl.com/3699857ff0a17d77d1099699cdf4da13?v=1490503337 刚开始读错题意,以为是不变序列,就想着区间dp但数据量肯定会t,,,没想到什么优化方法就放下了,后来队员发现序列是可变的。。。。任意的。。。。。 想着先排序在布拉布拉布拉,一直都没有逆向思维想到哈夫曼。只怪数据结构没认真听啊。。。。 想到哈夫

jerans的博客 947

EMC意义下的共模(Common Mode)和差模(Differential Mode)

在电子产品中,信号或电源通过两根导线传输。对比维度差模(DM)共模(CM)电流方向一进一出,相等相反同向、相等回流路径两根导线组成的闭合回路地或外壳EMC影响较小容易辐射干扰,重点治理类型定义有用信号干扰信号抑制方法常规滤波器、电感、电容共模电感、磁环、屏蔽、接地技术等。

weixin_43199439的博客 1261

CodeForces - 361D Levko and Array二分加dp

D. Levko and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Levko has an array that consists of inte

jerans的博客 840

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

visio安装包

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

Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2) C Fountains 乱搞

C. Fountains time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Arkady plays Gardenscapes a lot. Arkady wants

jerans的博客 811

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

codeforces 8VC Venture Cup 2017 - Elimination Round D PolandBall and Polygon

D. PolandBall and Polygon time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output PolandBall has such a convex poly

jerans的博客 726

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

B. The Meeting Place Cannot Be Changed

B. The Meeting Place Cannot Be Changed time limit per test 5 seconds memory limit per test 256 megabytes input standard input output standard output The main road in Byt

jerans的博客 697

Beautiful numbers CodeForces - 55D 数位dp

D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Volodya is an odd boy and his taste is

jerans的博客 677

Codeforces Round #423 (Div. 2) C. String Reconstruction思维 D. High Load 构造

C:http://codeforces.com/contest/828/problem/C 题意:有一个字符串,你知道他的一些子串所在的位置,求符合条件的字典序最小的原串 因为已知的数据较大,还存在较多重复的部分,直接暴力不可行 可以记录原串每个位置的下一个没确定出来的字符的位置(记住next【i】),优化后可以过,时间较长 #include #define eps 1e-9 #defin

jerans的博客 672

Codeforces Round #410 (Div. 2) C. Mike and gcd problem 贪心

C. Mike and gcd problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has a sequence A = [a1, a2, ..

jerans的博客 664

Codeforces Round #301 (Div. 2) D. Bad Luck Island 概率dp

D. Bad Luck Island time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Bad Luck Island is inhabited by thre

jerans的博客 649

Codeforces Round #424 (Div. 2)C. Jury Marks 暴力 D. Office Keys 二分 E. Cards Sorting 树状数组

C:http://codeforces.com/contest/831/problem/C。 题意:给两个序列a和b 有一个初始值,不断的加ai,要求是在加的过程中b的所有值都出现过,求这样满足条件的初始值有几个。 崩了,这么水的暴力竟然没想出来?? 先把所有的b值标记出来,随便选一个b,暴力放到某一个a后面,这样就可以直接找出原序列,看看b数组里的值是不是都出现过,如果出现过则这个序列满

jerans的博客 633

Codeforces Round #433(Div. 1,based on Olympiad of Metropolises)A Planning B Jury Meeting C Boredom

人生的第一次div.1 掉分 QAQ A - Planning http://codeforces.com/contest/853/problem/A 贪心,排个序,优先安排花费大的,用模拟链表实现的 #include #define eps 1e-9 #define PI 3.141592653589793 #define bs 1000000007 #define bsize

jerans的博客 627

Codeforces Round #410 (Div. 2) D. Mike and distribution 思维

D. Mike and distribution time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike has always been thinking abou

jerans的博客 608

Codeforces Round #390 (Div. 2//754D. Fedor and coupons

D. Fedor and coupons time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output All our characters have hobbies. The s

jerans的博客 583
上一篇: POJ 1703 Find them, Catch them
下一篇: Codeforces Round #381 (Div. 2) A Alyona and copybooks
jerans
博客等级 码龄10年 54粉丝 255原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值