当前位置:网站首页>Netease written test No. 2 -- typical application of European distance
Netease written test No. 2 -- typical application of European distance
2022-07-28 10:14:00 【Hua Weiyun】
Preface
Euclid measures (euclidean metric)( Also known as Euclidean distance ) Is a commonly used definition of distance , Referring to m The real distance between two points in dimensional space , Or the natural length of the vector ( That is, the distance from this point to the origin ). Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points .
The formula of two-dimensional space
0ρ = sqrt( (x1-x2)^2+(y1-y2)^2 ) |x| = √( x2 + y2 )
The formula of three-dimensional space
0ρ = √( (x1-x2)^2+(y1-y2)^2+(z1-z2)^2 ) |x| = √( x2 + y2 + z2 )
Their thinking : European distance cannot be 2, top left corner (4*4) Satisfy , In the upper right corner, you can see in the same line a[i][j-2] Is there a cake , If it does not exist , Then put the cake . If the lower left corner is in the same column , Then look at a[i-2][j] Is there a cake , If it does not exist , Then put the cake . For the lower right corner , Then look at a[i-2][j]、a[i][j-2] Is there a cake , If it does not exist , Then put the cake .
边栏推荐
猜你喜欢

关于软考高级要不要报班学习

2022 uni app parsing token standard - use jsrsasign - climb the pit

TCP Basics

15、判断二维数组中是否存在目标值

OSPF的拓展配置,选路原则,防环及重发布

Choosing a supplier service system is the first step for large health industry enterprises to move towards digital transformation
![[esp32][esp idf] esp32s3 quickly build lvglv7.9](/img/39/8efef047d0a9223b97819a54b5edf8.png)
[esp32][esp idf] esp32s3 quickly build lvglv7.9

Skillfully use NGX_ Lua makes traffic grouping

博弈论 1.Introduction(组合游戏基本概念、对抗搜索、Bash游戏、Nim游戏)

初识SuperMap iDesktop
随机推荐
PHP生成二维码(学习)
Redis面试题必知必会
Openatom openharmony sub forum, see you today at 14:00! Wonderful release of memorabilia attached
15、判断二维数组中是否存在目标值
ASP. Net core 6 framework unveiling example demonstration [29]: building a file server
海量数据TopN问题
LSA and optimization of OSPF
19. 删除链表的倒数第 N 个结点
基于ModelArts续写最伟大的作品【玩转华为云】
不登高山,不知天之高也;不临深溪,不知地之厚也
Fixedwindowrollingpolicy introduction
二分、三分、01分数规划【第III弹】
Tencent technical experts: decrypt the 100 million user products wechat, QQ, King glory... Comprehensively practice on the cloud!
Skillfully use NGX_ Lua makes traffic grouping
深度学习必懂的 13 种概率分布
[ESP32][esp-idf] esp32s3快速搭建LVGLV7.9
uni-app进阶之生命周期
Oracle中的小知识
14、双指针——盛最多水的容器
Edge team explains how to improve the comprehensive performance experience through disk cache compression technology