2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f48d1000cf542c50ffa0
|
2020-12-16 07:37:30 +00:00
|
|
|
|
title: 问题289:欧拉循环
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
|
|
|
|
|
2020-02-17 16:40:55 +00:00
|
|
|
|
令C(x,y)为穿过点(x,y),(x,y + 1),(x + 1,y)和(x + 1,y + 1)的圆。
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
对于正整数m和n,令E(m,n)为由m·n个圆组成的配置: {C(x,y):0≤x <m,0≤y <n,x和y是整数}
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
E(m,n)上的欧拉循环是一条闭合路径,它恰好通过每个圆弧一次。 E(m,n)上可能有许多这样的路径,但是我们只对那些不会自交叉的路径感兴趣: 非相交路径仅在格点处触碰自身,但从未相交。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
|
|
|
|
下图显示了E(3,3)和一个欧拉非交叉路径的示例。
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
令L(m,n)为E(m,n)上的欧拉非交叉路径数。 例如,L(1,2)= 2,L(2,2)= 37,L(3,3)= 104290。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
|
|
|
|
找出L(6,10)mod 1010。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
`euler289()`应该返回6567944538。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
|
assert.strictEqual(euler289(), 6567944538);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|