/*******************************************************************************
坑爹的地方比较多,首先所有质量都是没用的,因为无摩擦力;其次坐标最好都用double表示;还有那个
土豆是的坐标是相对于第一个peak的坐标,第四貌似有土豆可以不在peak的范围内。。。以后找min/max值
还是用第一个元素做标记比较好。。。
*******************************************************************************/
#include <iostream>
#include <functional>
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <bitset>
#include <cctype>
#include <cstdio>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;
#define LOWBIT(x) ( (x) & ( (x) ^ ( (x) - 1 ) ) )
#define CLR(x, k) memset((x), (k), sizeof(x))
#define CPY(t, s) memcpy((t), (s), sizeof(s))
#define SC(t, s) static_cast<t>(s)
#define LEN(s) static_cast<int>( strlen((s)) )
#define SZ(s) static_cast<int>( (s).size() )
typedef double LF;
typedef __int64 LL; //VC
typedef unsigned __int64 ULL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<char> VC;
typedef vector<double> VF;
typedef vector<string> VS;
template <typename T>
T sqa(const T & x)
{
return x * x;
}
template <typename T>
T gcd(T a, T b)
{
if (!a || !b)
{
return max(a, b);
}
T t;
while (t = a % b)
{
a = b;
b = t;
}
return b;
};
const int INF_INT = 0x3f3f3f3f;
const LL INF_LL = 0x7fffffffffffffffLL; //15f
const double oo = 10e9;
const double eps = 10e-7;
const double PI = acos(-1.0);
#define ONLINE_JUDGE
const int MAXN = 10004;
int test, n, m, w;
struct Peak
{
LF x, h;
}peak[MAXN];
struct Point
{
LF x, v;
}pnt[MAXN];
void ace()
{
int cas = 1;
LF ans = 0;
for (cin >> test; test--; ++cas)
{
cin >> n >> m >> w;
LF maxh = peak[0].h;
for (int i = 0; i < n; ++i)
{
cin >> peak[i].x >> peak[i].h;
maxh = max(maxh, peak[i].h);
}
ans = sqrt(2.0 * 20 * (maxh - peak[0].h));
for (int i = 0; i < m; ++i)
{
int tw;
cin >> pnt[i].x >> pnt[i].v >> tw;
pnt[i].x += peak[0].x;
for (int k = 0; k < n - 1; ++k)
{
if (peak[k].x < pnt[i].x + eps && pnt[i].x < peak[k + 1].x)
{
LF dh = peak[k + 1].h - peak[k].h;
LF dx = peak[k + 1].x - peak[k].x;
LF ph = peak[k].h + (pnt[i].x - peak[k].x) / dx * dh;
LF buf = pnt[i].v * pnt[i].v + 2.0 * 20 * (ph - peak[0].h);
if (buf + eps > 0)
{
ans = max(ans, sqrt(buf));
}
break ;
}
}
}
printf("Case %d: %.2lf\n", cas, ans);
}
return ;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
#endif
ace();
return 0;
}
/*******************************************************************************
Test Data...
1
6 2 100
0 0
2 5
3 2
4 1
5 3
8 -2
2 15 100
5 11 100
*******************************************************************************/
相关推荐
汽车OBD接口实战:如何用STM32读取CAN总线数据(附完整代码)
本文详细介绍了如何利用STM32微控制器通过汽车OBD接口读取CAN总线数据的完整实战方案。内容涵盖硬件连接(如OBD引脚定义与TJA1050收发器接线)、STM32的CAN外设初始化与滤波器配置,并深入解析OBD-II诊断协议,演示了如何请求和解析发动机转速、车速等关键数据。文末提供了构建稳定数据读取系统的代码框架与错误处理建议,为嵌入式开发者和汽车电子爱好者提供了从零到一的实践指南。
HDU Sum Problem (一道神坑的水题)
Problem Description Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a se...
UE 顶点动画工具 (VAT)
导入模型需要勾选全精度UV。
HDU 1010 比较坑人的一道搜索题
本人当初只是想到用搜索做,上手就是BFS结果WA了,后来反应过来只能用DFS来做 提交了21次,全TLE,后来在多次努力下找到了大量的陷阱,为还在为此题困扰的人指指路 1.奇偶剪枝 很简单的一个概念 设起点坐标是bx,by;终点坐标是ex,ey; 最短路径是abs(bx-ex)+abs(by-ey) 但是我们可以很显然的看出来,无论是走,我们的步数肯定比最短路径数多一个偶数 所以,简
AD20 Channel-Offset Error 解决办法
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录前言AD20 PCB相同电路模块ROOM格式复用时出现 Channel-Offset Error 解决办法一、问题现象二、解决办法 前言 AD20 PCB相同电路模块ROOM格式复用时出现 Channel-Offset Error 解决办法 一、问题现象 我们经常在使用Room格式快速布局相同模块电路时出现以下问题, 二、解决办法 相同模块电路PCB布局复制的过程网上有很多,这里不再做赘述,步骤都差不多,只说问题根源; 1:.
国产谷歌地球,地形分析秒杀同款地图软件
咱们做地质、林业、水文、水利、电力、GIS、地图、水保、环境的,需要经常用到各种数据,比如影像、地形、矢量、模型等,但目前80%的规划大数据展示都离不开ArcGIS,令人头大的是很多朋友连ArcGIS软件安装起来都费劲。。。 那不会ArcGIS又装不了Google Earth怎么开展工作? 今天推荐大家一款国产免费专业地图浏览下载测量分析神器—图新地球 图新地球,国产三维gis软件。可以查看高清卫星影像地形以及其他很多常用电子地图,对地图需求的掌握远胜过Google Maps,而且上手比国外软件要简单
HDU 4036 Rolling Hongshu(数学+物理应用)
Rolling Hongshu Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 1230Accepted Submission(s): 367 Problem Description To see his girl...
Zabbix7.4监控系统在Rocky Linux10.0上的完整部署流程(含MariaDB配置)
本文详细介绍了在Rocky Linux 10.0操作系统上部署企业级监控系统Zabbix 7.4的完整流程,并重点阐述了与MariaDB数据库的深度集成与性能优化配置。内容涵盖从系统环境准备、数据库安装与安全加固、Zabbix核心组件部署,到服务配置、Web界面初始化以及生产环境高级调优的全方位实战指南,旨在帮助用户构建稳定高效的监控平台。
HDU_4036 Rolling Hongshu
物理题,我把公式推错了。。。 两个限制条件,1、能爬上最高坡。2、Sweet Potato在每一个有Bitter Potatoes位置的速度大于等于Bitter 的速度。 设要求的初速度为pv 1、pv = sqrt(2*g*(maxh - h0)); 2、pv = tpv = sqrt(vi*vi + 2*g*hi); 为bitter potato纵坐标。 View Code...
多模态对齐方案
本文中我们介绍了 13 中常见的大型多模态模型(Large Multimodal Models, LMM),包括 BLIP-2,LLaVA、MiniGPT、Qwen-VL 以及 Ferret 等。最全 LMM 模型结构(13种)综述。单层linear投影、两层mlp。
Python从0到100(一):初识Python及安装Pycharm
Python从0到100(一):初识Python及安装Pycharm。Python是由荷兰人吉多·范罗苏姆(Guido von Rossum)发明的一种编程语言,是目前世界上最受欢迎和拥有最多用户群体的编程语言。
HDU 4847 坑题
诡异的题
海康威视嵌入式最全面试题及参考答案(3万字长文)
主营业务:提供包括前端摄像头、后端存储设备、显示控制设备等在内的全方位视频监控解决方案。市场地位:在全球范围内享有较高的市场份额,在安防领域具有较强的竞争力。技术创新:持续投入研发,拥有多项核心技术和专利,特别是在视频处理算法、人工智能等方面取得了显著成果。社会责任:积极参与公共安全项目,为智慧城市、交通管理等领域提供技术支持和服务。国际业务:除了国内市场外,海康威视的产品和服务也销往全球多个国家和地区。面向对象编程。
hdu 4036
View Code #includestdio.h>#includemath.h>#includestring.h>struct PEAK{ double x,h;}p[1100];struct bit{ double x,v,m;}pat[1100];int main(){ int G=20; double h; int t,cases=1,i,j,n,m,w;
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
Probability and Statistics - 4th edition
Probability and Statistics - 4th edition
HDU 4013 图论 树的最小表示
/******************************************************************************* 去年上海赛区热身赛的一道题,树的最小表示模板题。解法就是用二进制枚举所有可能的联通子图,然后 求所有联通子图的最小表示,要注意的是对于某一个联通子图,最小表示需要枚举联通子图里的所有的点,然 后从这些点开始进行dfs,dfs过程中进
大中型超市收银系统(可直接运行)
光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开
HDU 4121 模拟
/**************************************************************************************************** 坑爹的模拟题~注意这两种情况:黑方的将能直接飞过去杀了红方的将,还有将走一步能把红方别的子给吃了。。。 ******************************************
最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版
Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。
HDU 3644 计算几何 模拟退火
/* * ===================================================================================== * * Filename: hdu3644.cpp * * Description: Calculate Geometry -- Simulated annealing * *
HDU 4049 状态压缩DP
/******************************************************************************* 去年北京赛区网络赛水题,状态压缩DP,一开始TLE,然后发现是没初始化,应该用空间换时间来着, 接着WA,搞了半天没搞明白。。。最后发现发现一个小小的纰漏~~~ 解法就是建立状态dp[M][1 << N],用第一个状态表示
HDU 1512 左式堆 + 并查集
/* * ===================================================================================== * * Filename: hdu1512.cpp * * Description: Leftist Heap + Union Find Set * * Version
HDU 3656 DLX重复覆盖
/********************************************************************************* 纠结了良久,这个题是DLX的重复覆盖问题,以前还没见过,最后套了晓天大牛的模板,水过了。 还是模板题。。。因为最后的答案必然是某两点的距离,所以离散化一下所有距离后二分再套用DLX 重复覆盖模板就能AC了~赞一下神函数uniq
HDU 4123 树状DP+RMQ
/****************************************************************************************************************** 尼玛。。。神题。。。居然能卡RMQ的log2的。。。解法就是先用树状DP预处理整棵树,得到每个节点距离其他节点的最大值, 这个时间复杂度是O(n),然后在得到的
HDU 4031 树状数组 区间更新及点询问
/******************************************************************************* 去年成都赛区网络赛一道题,树状数组在区间更新中的应用。树状数组一般支持的是改点,查区间,但 是这道题要求的是改区间,查点,这就要变通一下,具体可以看代码,另外要考虑的一个问题是,如何统计? 这里的处理方法就是把总共的攻击次数-防御
HDU 4046 树状数组
/******************************************************************************* WA了N多次。。。结果是忘记初始化st数组了。。。悲剧得1B。。。 解法就是考虑修改位置id的字符,观察左右"wbw"是否被更改,如果被更改了,那么就更新下,这个地方要 特别小心。。。具体可以见代码~ ************
HDU 3657 网络流
/*************************************************************************************** 去年网络赛的一道题,现在看来也不是很难。做个HDU上那道方格取数的话,这道题大致就有想法了, 但这道题有个问题是,必选点的处理,我的做法是如果该点为偶数点,则在源点与该点间建一条流量为oo 的边,如果该点为奇数点,
HDU 3944 组合数学+数论
/******************************************************************************** 很好的组合数学题,跟数论结合,Lucas定理的应用,关键是这个转化: C(n, k) % p = C(n % p, k % p) * C(n / p, k / p) % p C(n, k) % p = n! / (k! *
HDU 4038 无题
/******************************************************************************** 倒不是什么太难的题,主要是细节太阴险了~具体见注释~ 最后学校排排名31~这几场网络赛都相当给力啊~今年挺有戏的~ **********************************************************
300



被折叠的 条评论
为什么被折叠?



