algorithm - 什么是 "external node"3 边形环的 "magic"?

标签 algorithm graph-theory

我想解决 Project Euler 的 problem #68在 C# 中,但到目前为止我还没有清楚地理解这个问题。此问题陈述中的外部节点是什么意思?

Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and each line adding to nine.

   4
    \
     3
    / \
   1 - 2 - 6
  /
 5

Working clockwise, and starting from the group of three with the numerically lowest external node (4,3,2 in this example), each solution can be described uniquely. For example, the above solution can be described by the set: 4,3,2; 6,2,1; 5,1,3.

最佳答案

'外部节点'是不包含在内部三角形(五边形)中的节点。第一张图中,4、5、6为外部节点。
关于“帮助理解问题”,还有哪些部分让您感到困惑?

编辑
第一句话说“每行加九”,这里的9是总数。您可以通过对 3 行中任意一行中的数字求和来计算每个解决方案的“总数”。

关于algorithm - 什么是 "external node"3 边形环的 "magic"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6394577/

相关文章:

java - 通过 1 遍查找链表的中间元素,这是创意 "useless answer"吗?

java - 递归爬楼梯算法

algorithm - 如何实现可自定义的 URL 缩短器?

algorithm - 错误 : no matching function for call to 'swap'

graph - Graphviz Dot 中奇怪的边缘位置

java - 为什么我在 Java 中实现的随机 Prim 算法只生成了完整的网格?

javascript - 可以相互访问的节点的有效分组

r - 获取相邻值的连通分量

cuda - GPU上的图形算法

perl - 如何在有向图中找到从源到汇的所有路径?