hdu5365 Run

解决ADS1.2报错Cannot obtain license 报错如下 将licenses文件下的license内容进行修改: 修改为如下内容即可。 # # Generated on 2021-dec-1 by licwizard # PACKAGE ads armlmd 1.200 E32F0DE5161D COMPONENTS="armasm compiler bats armulate axd adwu fromelf armlink codewarrior armsd" INCREMENT ads armlmd 1.200 permanent uncounte 阅读详情


Link:http://acm.hdu.edu.cn/showproblem.php?pid=5365


Run

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 529    Accepted Submission(s): 231


Problem Description
AFA is a girl who like runing.Today,he download an app about runing .The app can record the trace of her runing.AFA will start runing in the park.There are many chairs in the park,and AFA will start his runing in a chair and end in this chair.Between two chairs,she running in a line.she want the the trace can be a regular triangle or a square or a regular pentagon or a regular hexagon.
Please tell her how many ways can her find.
Two ways are same if the set of chair that they contains are same.
 

Input
There are multiply case.
In each case,there is a integer n(1 < = n < = 20)in a line.
In next n lines,there are two integers xi,yi(0 < = xi,yi < 9) in each line.
 

Output
Output the number of ways.
 

Sample Input
  
4 0 0 0 1 1 0 1 1
 

Sample Output
  
1
 

Source
 


编程思想:由于输入数据x、y坐标是整数,对应的点连起来不可能是正三角形、正五边形和正六边形,只可能是正四边形。根据正四边形的判定定理:四条边相等且有一个角是直角的四边形是正四边形。通过枚举每四个点所构成的六条边,若这四个点能构成正四边形,则其所构成的六条边中有四条是正四边形的边,另外两条是正四边形的对角线,且对角线比边长,故通过从小到大排序即可判断前4条边为正四边形的边,后两条为对角线。根据正四边形的边相等和正四边形的对角线与正四边形的边构成直角三角形的勾股关系,即可判定是否为正四边形。

AC code:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
#define LL long long 
#define exp 1e-10
#define MAXN 1000010
using namespace std;
const int INF=0x3f3f3f3f;
const int N = 100005;
const int mod = 1000000007;
int n,i,j,k,l,ans;
int x[33],y[33]; 
int e[33];
int main()
{
    while(scanf("%d",&n)!=EOF)
    {
    	for(i=1;i<=n;i++)
    	{
    		scanf("%d%d",&x[i],&y[i]);
		}
		ans=0;
		for(i=1;i<=n;i++)
		{
			for(j=i+1;j<=n;j++)
			{
				for(k=j+1;k<=n;k++)
				{
					for(l=k+1;l<=n;l++)
					{
						e[1]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]);
						e[2]=(x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]);
						e[3]=(x[i]-x[l])*(x[i]-x[l])+(y[i]-y[l])*(y[i]-y[l]);
						e[4]=(x[j]-x[k])*(x[j]-x[k])+(y[j]-y[k])*(y[j]-y[k]);
						e[5]=(x[j]-x[l])*(x[j]-x[l])+(y[j]-y[l])*(y[j]-y[l]);
						e[6]=(x[k]-x[l])*(x[k]-x[l])+(y[k]-y[l])*(y[k]-y[l]);
						sort(e+1,e+7);
						if(e[1]==e[2]&&e[2]==e[3]&&e[3]==e[4]&&e[3]+e[4]==e[5])
						{
							ans++;
						}
					}
				}
			}
		}
		printf("%d\n",ans);
	}
}



7、复杂分布式水文模型的两阶段代理参数校准框架 本文提出了一种针对复杂分布式水文模型的两阶段代理参数校准框架,旨在解决可变入渗能力模型(VIC)在参数校准过程中计算成本高、耗时长的问题。该框架结合AdaBoost与反向传播神经网络(BPNN)构建高精度代理模型,并引入ε-NSGA II多目标优化算法加速搜索最优参数集。通过在兰江流域和湘江流域的实验验证,该方法在校准效率上提升了约20倍,同时保持了高模拟精度(NSE接近1,Bias接近0)。框架采用两阶段设计:第一阶段(SM-I)快速筛选关键参数范围,第二阶段(SM-II)进行高精度预测,显著减少了无效计 阅读详情

相关推荐

【spark源码修改】hive3.1.3 spark3.5.4编译,需要修改源码,最终编译成功

【spark源码修改】hive3.1.3 spark3.5.4编译,需要修改源码,最终编译成功,附带问题分析详细过程

spark_dev的博客 1912

HDU 5365(计算几何)

Run Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 101Accepted Submission(s): 43 Problem Description AFA is a girl who like runing....

aisaihui6702的博客 226

MATLAB PDE工具箱电磁场仿真平行电容板及电偶极子详解

首先打开matlab,在命令行输入pdetool打开PDE工具箱 工具箱的功能我就不赘述了,大概就是以有限元的数值计算方法,计算二阶偏微分方程,因此可以解决电磁场、热力学等问题。 首先点击左上角按钮,画三个矩形 画完一个后可以双击矩形编辑,参数如下: 其中R1表示上极板,R2表示下极板,R3表示整个空间区域。 在上方Set formula为R3-R2-R1,表示求解区域是整个空间区域减去两个极板。下拉框选择Electrostatics表示求解的是静电场问题。 接下来点击上方菜单栏中的这个按钮,表

weixin_42845306的博客 1万+

HDU 5365 Run 计算几何 枚举 组合

Run Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 391    Accepted Submission(s): 173 Problem Description AFA is a girl who like run

colorfulshark 688

el-transfer和el-tree进行结合搞一个树形穿梭框

由于业务需求需要在穿梭框里使用树形结构,但是本身element里并不支持,于是参考了别的大佬发的文章作为思路及后续自己新增了一些处理功能。

bbkhhvv的博客 6305

Claude Code + 自定义模型体验

AI 编程工具的发展突飞猛进:Cursor 横空出世,推出了“Agent 模式”;新竞争者如 Windsurf 也纷纷加入战局。几乎所有产品都开始转向“代理式(agentic)”开发模式——不再依赖单次 LLM 响应进行补全,而是让大模型在一个循环中调用各种工具,来完成更复杂的任务:分析代码库上下文、读取网页与文档、编译程序、运行测试、修复失败构建或测试、不断迭代等。

西京刀客 5790

【城会玩系列】hdu 5365 Run【计算几何相关】

Run Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1068    Accepted Submission(s): 471 Problem Description AFA is a girl who like

mengxiang000000 512

一文入门Qwen-Agent【附实战代码】

Qwen-Agent 是一个开源框架,用于开发基于 Qwen 模型的 AI 智能体应用,一文带你入门使用

m0_55303420的博客 1873

HDU 5365-Run(几何)

题目地址:HDU 5365 题意: 问题描述 小花是一个热爱健身的姑娘,这天她下载了一个跑步软件,这个软件可以记录下小花跑步的轨迹。小花决定去公园跑步。公园里有许许多多的座椅,小花希望在一些座椅休息一下,并且她在两条座椅之间只跑直线。小花是一个完美主义者,她希望自己最后的轨迹是一个正三边形或者正四边形或者正五边形或者正六边形。小花会从某条座椅开始打开跑步软件,并在回到这个座椅后关闭。 请问小

Rocky0429 1569

ESP32编译卡在‘Cannot establish a connection to the component registry’?别急着重装,先试试这两个国内镜像配置

本文详细解析了ESP32编译过程中常见的‘Cannot establish a connection to the component registry’报错问题,并提供了国内镜像源的配置方案。通过对比Gitee、清华大学、阿里云和中科大等镜像源的性能,帮助开发者快速解决网络连接问题,提升编译效率。文章还包含手把手的配置教程和进阶技巧,适用于ESP-IDF开发环境的优化。

weixin_34088048的博客 341

WRFDA如何读取风云四号A 星的GIIRS数据?

🏆本文收录于 《全栈 Bug 调优(实战版)》 专栏。专栏聚焦真实项目中的各类疑难 Bug,从成因剖析 → 排查路径 → 解决方案 → 预防优化全链路拆解,形成一套可复用、可沉淀的实战知识体系。无论你是初入职场的开发者,还是负责复杂项目的资深工程师,都可以在这里构建一套属于自己的「问题诊断与性能调优」方法论,助你稳步进阶、放大技术价值。

**My Coding Family** 1025

HDU 5365

1

大咸鱼。。。 901

【智能模型系列】基于Unity和MediaPipe【手部追踪+手势识别】系统开发指南

在本文中,我将详细介绍一个基于MediaPipe的Unity手势识别系统,该系统能够识别多种常见手势(如拳头、点赞、胜利手势等),并提供完整的事件系统来处理手势状态变化。这个系统非常适合用于VR/AR交互、手势控制游戏或任何需要自然用户界面的应用场景。

纯技术流日常开发商业开发记录总结等 582

hdu 5365 Run(几何)

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5365 解题思路: 官方题解说: 地球人都知道整点是不能构成正五边形和正三边形和正六边形的,所以只需暴力枚举四个点判断是否是正四边形即可。假如你不是地球人,那么即使暴力枚举正三边形和稍微不那么暴力地找正五边形和正六边形也是可以通过的(反正找不到) 瞬间感觉智商被压制了,网上有一个证明

piaocoder 701

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

hdu5365Run 暴力

//给n个坐标,问能构成多少个不同的正三边形,正四边形,正五边形,正六变形 //题解说地球人都知道整点是不能构成正五边形和正三边形和正六边形的, //然后就只需要暴力找正四边形 //突然感觉原来我不是地球人includeincludeincludeincludeusing namespace std ;define dis(a,b,c,d) (((a-b)(a-b) + (c-d)(c-d))

ijbuhv的专栏 818

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

hdu 5365 Run

。。。

禅境花园 549

Hdu 5365 Run

关于这题,先看看官方的解释:地球人都知道整点是不能构成正五边形和正三边形和正六边形的,所以只需暴力枚举四个点判断是否是正四边形即可。假如你不是地球人,那么即使暴力枚举正三边  形和稍微不那么暴力地找正五边形和正六边形也是可以通过的(反正找不到)。 那么很明显,接下来要思考就是如何找正四边形,只找四条相连且相等的边是不够的,因为四边相连且相等的可能是菱形,不是正四边形。 我的思路...

weixin_30660027的博客 166

HDU-5365-Run

Problem Description AFA is a girl who like runing.Today,he download an app about runing .The app can record the trace of her runing.AFA will start runing in the park.There are many chairs in the park,

Wilbert的博客 581

HDU 5365 Run

Problem Description AFA is a girl who like runing.Today,he download an app about runing .The app can record the trace of her runing.AFA will start runing in the park.There are many chairs in the pa

Occult 407

HDU 5365 Run(暴力)

题意:给一个n和n个整数坐标问这些点能组成几个不同正三角形,正方形,正五边形,正六边形。 分析:由于坐标都是整数,使用只可能有正方形,其他都不可能,那么只要对于每四个不同的点,判断2组对边相等,两条对角线也相等,临边也相等即可。 代码: #include #include #include #include #include #pragma comment(link

sin_XF的专栏 690

HDU 5365 Run

题意:给n个整点,问用其中若干个做顶点能够成多少个正三角形或正四边形或正五边形或正六边形。 解法:出题人说 地球人都知道整点是不能构成正五边形和正三边形和正六边形的,所以只需暴力枚举四个点判断是否是正四边形即可。假如你不是地球人,那么即使暴力枚举正三边形和稍微不那么暴力地找正五边形和正六边形也是可以通过的(反正找不到)。 然而我的数学是体育老师教的……判正方形也写不明白……【哭...

weixin_30772261的博客 123

HDU 5365 Run [Ad Hoc]

Description有N个格点,取若干个点组成正多边形,问有几个Algorithm格点正方形只有正方形 枚举4个点 然后就是这题算法Code#include <iostream> #include <algorithm> using namespace std; const int maxn = 20 + 9; struct P { int x, y; }; int dist2(P a,

more time 474

HDU 5365 Run(大水题)

大致题意: 8*8的整点格子,输入16个整点,求多少种点的集合可以组成正3,正4,5,6边形 思路:sb题啊...整点格子组成不了n !=4的所有正多边形,只要判是否能组成正方形就可以了 这里有个优美的无穷递降的证明:http://www.zhihu.com/question/25304120 而我是枚举所有点的集合判断是否能组成正多边形的蠢方法= =,先用凸包对点排个序,

kalilili的专栏 689

hdu 5365 Run 枚举

Run Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 839    Accepted Submission(s): 361 Problem Description AFA is a girl who like r

G.D.Retop的专栏 496

HDU5365Run(计算几何)详解

题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=5365 题目: Run Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 853    Accepted Submissio

ACMan 457

BestCoder Round #50 (div.2) HDU 5365 Run(简单几何)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5365 题面:(严重吐槽,看着真不舒服,还是改一下吧) Run Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 5

David_Jett 1158
上一篇: The mook jong(找规律+组合数学“隔板”思想)
下一篇: 确定比赛名次(拓扑排序模板(比之前的模板纠正和完善了,之前的会有bug,一些题有时会wa))
林下的码路
博客等级 码龄12年 295粉丝 506原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

林下的码路

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值