POJ 1113 WALL

【纯实战】C#基于TCP/IP实现三菱PLC MC协议完整通信(含完整源码+通信原理+避坑指南) MC协议是三菱电机为旗下MELSEC系列PLC量身定制的以太网专用通信协议,本质是一套基于TCP/IP的应用层协议规范,专门用于实现上位机(PC/工控机)与PLC之间的双向数据交互,支持对PLC的软元件(X/Y/M/D/W/T/C等)进行读、写、批量读写等核心操作,同时支持PLC状态查询、程序启停等控制指令。重要:三菱PLC的MC协议默认基于TCP 4999端口通信,部分新版本FX5U/Q系列也支持TCP 5000端口,核心通信逻辑一致。 阅读详情

 

Wall
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 13254 Accepted: 4217

Description

Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he would not listen to his Architect's proposals to build a beautiful brick wall with a perfect shape and nice tall towers. Instead, he ordered to build the wall around the whole castle using the least amount of stone and labor, but demanded that the wall should not come closer to the castle than a certain distance. If the King finds that the Architect has used more resources to build the wall than it was absolutely necessary to satisfy those requirements, then the Architect will loose his head. Moreover, he demanded Architect to introduce at once a plan of the wall listing the exact amount of resources that are needed to build the wall.

Your task is to help poor Architect to save his head, by writing a program that will find the minimum possible length of the wall that he could build around the castle to satisfy King's requirements.

The task is somewhat simplified by the fact, that the King's castle has a polygonal shape and is situated on a flat ground. The Architect has already established a Cartesian coordinate system and has precisely measured the coordinates of all castle's vertices in feet.

Input

The first line of the input file contains two integer numbers N and L separated by a space. N (3 <= N <= 1000) is the number of vertices in the King's castle, and L (1 <= L <= 1000) is the minimal number of feet that King allows for the wall to come close to the castle.

Next N lines describe coordinates of castle's vertices in a clockwise order. Each line contains two integer numbers Xi and Yi separated by a space (-10000 <= Xi, Yi <= 10000) that represent the coordinates of ith vertex. All vertices are different and the sides of the castle do not intersect anywhere except for vertices.

Output

Write to the output file the single number that represents the minimal possible length of the wall in feet that could be built around the castle to satisfy King's requirements. You must present the integer number of feet to the King, because the floating numbers are not invented yet. However, you must round the result in such a way, that it is accurate to 8 inches (1 foot is equal to 12 inches), since the King will not tolerate larger error in the estimates.

Sample Input

9 100
200 400
300 400
300 300
400 300
400 400
500 400
500 200
350 200
200 200

Sample Output

1628

Hint

结果四舍五入就可以了

Source

 

http://acm.pku.edu.cn/JudgeOnline/problem?id=1113

 

 

用 CL_HTTP_CLIENT 正确处理 Cookie,彻底解决 SAP Gateway OData 的 CSRF Token 校验失败 SAP OData 集成中 CSRF Token 校验失败的解决方案 问题现象:使用 Postman 测试 OData 写入成功,但 ABAP 代码调用时出现 CSRF token validation failed 错误。 根本原因:Postman 自动处理 Cookie,而 ABAP 代码仅获取了 CSRF Token 却遗漏了 Cookie 信息。SAP Gateway 要求修改请求必须同时携带 Token 和 Cookie 才能通过校验。 解决方案: 通过 GET 请求同时获取 CSRF Token 阅读详情

相关推荐

告别串口打印:手把手教你用Qt Creator远程调试i.MX6开发板(附gdbserver配置)

本文详细介绍了如何使用Qt Creator配合gdbserver实现i.MX6等ARM开发板的远程调试,告别传统的串口打印调试方式。通过图形化界面设置断点、监控变量,显著提升嵌入式开发效率,适用于各类ARM架构开发板的调试需求。

weixin_30781775的博客 217

poj1113Wall【凸包】

Language: Default Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 32437   Accepted: 11008 Description Once upon a time there was a greedy King who o

走一步再走一步 1748

全桥LLC谐振变换器变频控制工作原理与仿真

全桥LLC谐振变换器以其效率高、全范围软开关、器件电应力小等优点,越来越多地应用于大功率场合。电力电子技术的发展日益追求高频化,所带来的问题是半导体开关器件高频运行时的开关损耗急剧增加。各种软开关电路随之出现。可以有效减小开关损耗,使进一步提高开关频率成为可能。谐振式开关因其可在电流自然过零点开通半导体器件,实现零电压开关,特别适合采用MOSFET作开关的装置。最简单的谐振电路有串联谐振(SRC)和并联谐振(PRC)。SRC只能工作于降压状态,应用受限;

晞子的技术札记 3074

ACM-计算几何之Wall——poj1113

ACM 计算几何 Wall poj1113 求凸包周长

继续激情,继续奋斗。 1891

Python在Windows环境下驱动乐视三合一摄像头的深度图像处理实践

本文详细介绍了在Windows系统下,使用Python驱动乐视三合一摄像头进行深度图像处理的完整实践流程。从环境配置、驱动安装、OpenNI与OpenCV库的部署,到深度与彩色数据流的读取、可视化、三维点云转换以及背景移除等应用开发,为开发者提供了从零开始掌握深度摄像头编程的实战指南。

gitlab7runner的博客 232

STM32H743VIT6最小系统板PCB设计全流程(AD09实战教程+封装库分享)

本文详细介绍了基于STM32H743VIT6高性能MCU的最小系统板PCB设计全流程。内容涵盖从项目规划、原理图设计到PCB布局布线的AD09实战操作,重点解析了高速电路设计中的电源、时钟、去耦等关键模块的处理要点与常见陷阱,并分享了经过验证的封装库资源,旨在为工程师提供一套完整、可靠的设计方法与实战参考。

weixin_29194693的博客 118

POJ 1113 Wall 题解 《挑战程序设计竞赛》

为什么80%的码农都做不了架构师?>>> ...

weixin_33881753的博客 286

RK-XCKU5P RoCEv2 传感器桥工程分析报告

烧入后这块 FPGA 就是一个固定身份(CA:FE:C0:FF:EE:00 / 192.168.0.2 / 无 FEC 100G)的RoCEv2 UC 端点,每秒在 UDP 12267 广播自报家门;对端 CX5 只要关 FEC、配 192.168.0.101 +MTU 4200,就能 ping 通它、用 UDP 8192 读写它的全部寄存器、再按"ECB 旁路交换 QPN/rkey"的方式建立 UC RDMA 通道收发数据。

eloudy的专栏 245

POJ 1113 Wall(凸包应用)

POJ 1113 Wall(凸包应用) http://poj.org/problem?id=1113 题意: ZOJ1456        给你一个多边形X的所有点,要你用一个另一个图形A把这个多边形围起来,使得该多边形的周长最小且该图形A上的每一个点离原始边行的距离>=L. 要你求图形A的最小周长? 分析:        首先该图形A的最小周长肯定是X的凸包长度+半径为L的圆周长之和.

code 1023

CentOS 7 常用命令大全

CentOS中Linux命令

m0_63075763的博客 2018

告别双系统!用PhyFusion在麒麟V10上无缝融合Win11,文件互传、GPU加速全搞定

本文详细介绍了在飞腾D3000平台上使用PhyFusion实现麒麟V10与Win11无缝融合的解决方案。通过视觉无界、数据互通和性能无损的三大突破,PhyFusion显著提升了跨系统工作效率,支持GPU加速和文件互传,是国产化平台的革命性工具。

weixin_28707365的博客 1016

poj1113Wall(凸包周长计算)

poj1113Wall(凸包周长计算):http://poj.org/problem?id=1113 题目描述: Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35235   Accepted: 11996 Description Onc

而濡木染 791

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

POJ 1113 Wall(求凸包周长)

题目链接: POJ 1113 Walla//228K 0MS #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <climits> #include <cmath> using namespace std; const double PI=acos(-1.0); const

ramay7 500

SAP B1中文培訓教材_SDK

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

深度学习工具包 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")

POJ 1113 Wall (凸包求周长)

题意:在距城堡距离大于L的地方建围墙将城堡围起来求所要围墙的长度 思路:这道题的答案是凸包周长加上一个圆周长,即包围凸包的一个圆角多边形,但是没弄明白那些圆角加起来为什么恰好是一个圆。每个圆角是以凸包对应的顶点为圆心,给定的L为半径,与相邻两条边的切点之间的一段圆弧。每个圆弧的两条半径夹角与对应的凸包的内角互补。假设凸包有n条边,则所有圆弧角之和为180°*n-180°*(n-2)=360°。故

qq_36782366的博客 401

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

【POJ1113】Wall

Wall Time Limit:1000MS Memory Limit:10000K Total Submissions:24604 Accep...

diludiliang27877的博客 202

poj 1113 Wall (凸包)

题意:给定多边形城堡的n个顶点,绕城堡外面建一个围墙,围住所有点, 并且墙与所有点的距离至少为L,求这个墙最小的长度 思路:最小长度=城堡顶点构成的凸包的总边长+半径为L的圆的周长 先用Graham算法求出凸包,再枚举其顶点求两两之间的边长,记得加上第一个顶点和最后一个顶点的边长 最后要输出四舍五入的整数结果,可以用double存,最后用%.0lf输出

happy_lcj 1272

【poj1113】 Wall

http://poj.org/problem?id=1113 (题目链接)题意:给定多边形城堡的n个顶点,绕城堡外面建一个围墙,围住所有点,并且墙与所有点的距离至少为L,求这个墙最小的长度。Solution   凸包裸题。凸包的构造的话,有一篇博客写得很好,就是看着有点乱,界面太丑了= =。   很容易发现,所求的的墙的最小长度实际上就是平面凸包的周长加上以L为半径的圆的周长。这个圆是怎么来的呢

MashiroSky的博客 589

Poj 1113 Wall

地址:http://poj.org/problem?id=1113 题目: Wall Time Limit:1000MS Memory Limit:10000K Total Submissions:36064 Accepted:12315 Description Once upon a time there was a g...

weixin_30726161的博客 103

POJ1113 Wall

求凸包

H992109898的博客 610

POJ1113 Wall + CodeForces166B Polygons 凸包问题

第一次写凸包的代码,虽然过了,但是这个原理emmmm... 用的Graham和Andrew算法,记录下来方便以后看吧。。   1.POJ1113  Wall  凸包 就是用的kuangbin的模板,附AC代码: #include&lt;cstdio&gt; #include&lt;cstring&gt; #include&lt;cstdlib&gt; #include&lt;cmath...

A confused programmer 333

HDU 1348 和 POJ 1113 wall

首先,这次换了个算法来写,我用了Melkman 问题就来了,不知道怎么的,POJ1113的话,代码上去倒是可以AC。。。 但是在HDU的时候自己就o(╯□╰)o。。。 到底是怎么疑惑ing。。。。 View Code 1 #include <iostream> 2 #include <algorithm> 3 #i...

dicuanjiang7084的博客 181

POJ1113:Wall

POJ1113求完凸包算总长度,然后+2piL。结束。 我还sb的把每个角都求了一遍加起来。。后来发现其实就是360°。 重要的事情说三遍:用C++!用C++!用C++!【代码】#include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #define N 10005 #define INF 0x7fff

Heret1c 382

Wall POJ - 1113

Wall POJ - 1113 (凸包) Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King’s castle. The King was so greedy, that he would not listen to his Architec...

qq_45014570的博客 155

POJ 1113 wall

POJ上题目原文     题目大意就是给你一些点,然后你找出将他们包围所需要的最少的代价,相当于就是求用一根绳子将他们包围起来,求绳子的长度。有个特殊的要求就是,必须绳子与最外面的构成的多边形的距离必须大于等于 L 。其实就是将多边形的周长加上以 L 为半径的圆的周长即可。     裸的凸包,要是对求凸包的代码熟悉的话,直接上模板,由于本人刚写凸包没多久,所以还是自己老老实实的写了一遍凸包,当

蛤蛤~ 562

POJ 1113 Wall 【凸包入门】

原题连接:http://poj.org/problem?id=1113 题意:给 n 个点,你见一个围墙,使所有的点到围墙的距离不小于 l 。求围墙长度。。 思路:先求出n个点的 凸包,然后根据凸包建一个围墙,围墙的一部分就是 凸包长度,另一部分 是一个 以 l 为半径的 圆!! 代码: #include #include #include #include using namespa

nyist_飘谊 1483

POJ 1113 Wall

题目链接 凸包链接 Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King’s castle. The King was so greedy, that he would not listen to his Architect’s proposals to build a beautiful brick wall with a pe

qq_43735840的博客 267
上一篇: POJ 1112 Team Them Up
下一篇: POJ 1119 Start Up the Startup
bobten2008
博客等级 码龄18年 153粉丝 157原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值