#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <vector>
#include <map>
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define ll long long
#define ull unsigned long long
#define uint unsigned int
#define l(x) ((x)<<1)
#define r(x) ((x)<<1|1)
#define lowbit(x) ((x)&(-(x)))
#define ms(a,b) memset(a,b,sizeof(a))
#define NSYNC std::ios::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0);
using namespace std;
const double PI = acos(-1.0);
struct point {
int x, y;
}list[1111];
int sta[1111], top;
int cross(point p0, point p1, point p2) {
return (p1.x - p0.x)*(p2.y - p0.y) - (p1.y - p0.y)*(p2.x - p0.x);
}
double dis(point p1, point p2) {
return sqrt((double)(p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y));
}
bool cmp(point p1, point p2) {
int temp = cross(list[0], p1, p2);
if (temp > 0) return true;
return temp == 0 && dis(list[0], p1) < dis(list[0], p2);
}
bool tcmp(const point &p1, const point &p2) {
if (p1.y == p2.y)return p1.x < p2.x;
return p1.y < p2.y;
}
void init(int n) {
for (int i = 0; i < n; i++)
scanf("%d%d", &list[i].x, &list[i].y);
/*sort(list, list + n, [](const point &p1,const point &p2) {
if (p1.y == p2.y)return p1.x < p2.x;
return p2.y < p2.y;
});*/
sort(list, list + n, tcmp);
sort(list + 1, list + n, cmp);
}
void graham(int n) {
if (n == 1) { top = 0; sta[0] = 0; }
if (n == 2) {
top = 1;
sta[0] = 0;
sta[1] = 1;
}
if (n > 2) {
for (int i = 0; i <= 1; i++)
sta[i] = i;
top = 1;
for (int i = 2; i < n; i++) {
while (top > 0 && cross(list[sta[top - 1]], list[sta[top]], list[i]) <= 0)
top--;
top++;
sta[top] = i;
}
}
}
int main() {
int n, l;
while (scanf("%d%d", &n, &l) != EOF) {
init(n);
graham(n);
double res = 0;
for (int i = 0; i < top; i++)
res += dis(list[sta[i]], list[sta[i + 1]]);
res += dis(list[sta[0]], list[sta[top]]);
res += 2 * PI*l;
printf("%d\n", (int)(res + 0.5));
}
return 0;
}
相关推荐
两相交错并联BuckBoost变换器仿真模型(Simulink仿真实现)
内容概要:本文档系统整合了电力电子与新能源领域的Simulink仿真资源,聚焦于两相交错并联Buck-Boost变换器的双闭环PWM控制建模与仿真,同时涵盖多种典型拓扑结构,包括交错并联Boost、PFC功率因数校正、LLC谐振变换器、双向CLLC、DAB变换器、VIENNA整流器等。资源体系完整,包含仿真模型、设计报告、计算书、PPT说明文档及Matlab/Python代码,覆盖从基础建模到高级控制策略(如软开关技术、谐波抑制、状态估计、双闭环控制)的全流程。此外,还拓展至状态估计(卡尔曼滤波、粒子滤波)、智能优化算法、机器学习、信号处理、路径规划等多个交叉学科方向,构建了一个面向科研与工程应用的综合性技术平台。; 适合人群:电气工程、自动化、电力电子、新能源科学与工程等专业的硕士博士研究生、高校科研人员,以及从事新能源发电、智能电网、电动汽车、电力传动等领域技术研发的工程师。; 使用场景及目标:①开展电力电子变换器(如Buck-Boost、LLC、DAB、PFC等)的建模、控制与仿真研究;②支撑课程设计、学位论文、科研项目中的系统仿真与算法验证;③学习并复现高水平期刊(如EI)提出的先进控制策略,如基于KKT条件的最优控制、扩展移相调制、恒压恒流双环竞争控制等;④结合智能算法(如粒子群、秃鹰算法)进行微电网调度、储能配置、路径规划等多目标优化问题的研究与快速原型开发。; 阅读建议:建议依据提供的资源目录循序渐进地查阅资料,优先选取与自身研究方向高度契合的内容进行深入学习;应结合仿真模型与配套文档动手实践,调试参数并分析结果,充分利用百度网盘与公众号渠道获取完整资源,提升科研工作的系统性、规范性与创新性。
C++ 刷POJ等类似题目注意情况
1.注意边界值; 2.尽量用数组
【基于Zernike矩的良性和恶性肿块的分类】应用于乳腺癌诊断中的快速相反权重学习规则(Matlab代码实现)
内容概要:本文详细介绍了基于Plecs软件构建的全桥LLC谐振变换器仿真模型,重点阐述了其在软开关技术条件下的建模方法与仿真分析过程。该模型能够精确模拟LLC谐振变换器在不同运行工况下的动态响应特性,涵盖开环与闭环控制策略的设计与实现,适用于研究变换器的效率优化、谐振参数匹配、系统稳定性及软开关性能等问题。相较于Simulink等传统仿真工具,Plecs在高频电力电子系统仿真中展现出更高的仿真速度与数值精度,尤其适合用于复杂电力电子拓扑的快速原型验证与优化设计。; 适合人群:具备扎实电力电子技术基础和仿真经验,从事高频功率变换器设计、新能源电源开发、电力电子系统研究的研发工程师及高校研究生。; 使用场景及目标:①深入理解全桥LLC谐振变换器的工作原理与软开关实现机制;②掌握在Plecs环境中搭建高精度、高效率电力电子系统仿真模型的方法;③开展变换器控制策略(如变频控制、闭环稳压)的仿真验证与参数优化;④为科研课题、学位论文或工业项目提供可靠的仿真平台与技术支持。; 阅读建议:建议结合相关电力电子教材与LLC变换器设计指南,深入掌握谐振参数计算与系统稳定性分析方法,并通过反复调试仿真模型,观察关键波形(如原边电流零点切换、副边整流波形),以全面理解软开关过程的物理本质与控制实现细节。
cf 1312 D 逆元模板
Your task is to calculate the number of arrays such that: each array contains n elements; each element is an integer from 1 to m; for each array, there is exactly one pair of equal elements; for each ...
【Python实战解析】从数据爬取到房价预测:一个完整的数据科学项目流程拆解
本文详细拆解了一个完整的Python数据科学项目流程,从爬取长沙二手房数据到房价预测模型构建。通过实战案例,介绍了数据爬取、清洗、可视化及模型优化的关键技巧,帮助开发者掌握Python在数据分析中的应用,提升程序开发能力。
国产FPGA逆袭!深度评测复旦微RFVU3P5G核心板在相控阵雷达中的表现
本文深度评测了复旦微RFVU3P5G核心板在相控阵雷达中的实战表现。该核心板凭借射频直采架构、高采样率ADC/DAC及丰富的DSP资源,在多通道同步精度、动态范围及系统稳定性等关键指标上表现出色,展现了国产FPGA在高端雷达应用中的硬核实力与供应链自主价值。
cf edu 89 d 求一个数的因子和与自己互质
题意: 输入n(1≤n≤5*105) ,在输入n个数,问你对于ai(2≤ai≤107) ,是否存在ai的两个因数d1>1 and d2>1,且gcd(d1+d2,ai)=1。有就输出d1,d2,没有就输出-1. input 10 2 3 4 5 6 7 8 9 10 24 output -1 -1 -1 -1 3 -1 -1 -1 2 2 -1 -1 -1 -1 2 -1 -1 -1 5 3 (输出数据的每一列表示一个ai的答案,比如第5列,表示a5–即6的答案) 思路: 对于每一个ai,先保存
SGM5860x高精度ADC驱动开发与SPI接口实战指南
本文详细介绍了SGM5860x高精度ADC芯片的驱动开发与SPI接口配置实战。内容涵盖芯片特性、SPI通信设置、寄存器映射、驱动初始化、数据采集处理、校准优化及调试技巧,帮助开发者快速掌握国产24位ADC的应用,提升工业测量项目的精度与稳定性。
poj 1091 (容斥原理)
#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #includ...
告别调参烦恼:用Simulink手把手实现自适应模糊PID温度控制(附模型下载)
本文详细介绍了如何使用Simulink实现自适应模糊PID温度控制,解决传统PID调参难题。通过模糊推理引擎动态调整PID参数,系统能自动适应不同工况,显著提升控制精度和响应速度。文章包含完整的建模步骤、参数优化技巧和工业应用扩展,并附赠可下载模型,帮助工程师快速掌握这一智能控制技术。
【python3.7】解决报错 error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++
解决pip安装py7zr遇到的报错问题。
bzoj 2818 欧拉函数
第一种思路,就是对于某个数q,跟他互质的数p,kp和kq的最大公约数是k,那么这个数能组成的答案的数量就是phi[i]乘以某个质数,且乘积小于n 基于这种思路写下这个代码 #include <cstdio> #include <iostream> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue>
海洋与地质地理信息数据下载网站汇总集锦
各种海洋与地质地理信息数据集合
poj 3126 (素数筛)
#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #includ...
GEE开发之ERA5(气温、降水、压力、风速等)数据获取和分析
前言:ERA5主要提供DAILY和MONTHLY两大类别数据,其中主要包括气温、降水、压力、风速等。
2026年职业院校技能大赛中职移动应用与开发模块二10套题库开发培训视频(全套)
2026年职业院校技能大赛中职移动应用与开发模块二10套题库开发培训视频(全套)
poj 1061 (ext_gcd)
要用long long 要判断a是否小于零 要判断结果是否小于0 #include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <qu...
jre9下载 jdk9
(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】
cf 1312 c
Suppose you are performing the following algorithm. There is an array v1,v2,…,vn filled with zeroes at start. The following operation is applied to the array several times — at i-th step (0-indexed) y...
精雕软件(JDpaint) 5.5 绿色版
精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版
TMS_WebGMaps_1.9.8.0_Full_Source
TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder
数论(好题)
给你一个数组a,求ans=(a1+a2)^ (a1+a3)^ …(a n-1+a n),(共(n+1)*n/2项),数组长度是10的5次方,ai是10的7次方的,求ans。 解析:一位一位的算。一堆0和1异或的结果,只和其中的1的个数有关,与0个个数无关。 #include <cstdio> #include <cstdlib> #include <cstring&g...
RU DOS版、EFI版32bit/64bit BIOS常用工具
DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。
poj 1284
若p为奇素数,则p有euler(p-1)个原根 int get_euler(int n) { int res = n, a = n; for (int i = 2; i*i <= a; i++) { if (a%i == 0) { res = res / i * (i - 1); while (a%i == 0)a = a / i; } } if (a > ...
poj 2084
递推公式 k(n)=(4n-2)/(n+1)*k(n-1) 通项公式 k(n)=c(2n,n)/(n+1) = 2n!/n!/(n-1) h(0) = 1; import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { ...
poj 1930 (gcd)
#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #inclu...
poj 3233 矩阵快速幂
构造一个左上角是A+A2+A3 …的矩阵,然后去算就可以了 #include <cstdio> #include <iostream> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #include <vector> #include
poj 1995
#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #includ...
poj 3421
#include <iostream> #include <cstdio> #include <iomanip> #include <string> #include <cstdlib> #include <cstring> #include <queue> #include <set> #includ...
1294



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



