2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f50c1000cf542c51001e
|
2020-12-16 07:37:30 +00:00
|
|
|
|
title: 问题415:泰坦尼克号集
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
2021-01-13 02:31:00 +00:00
|
|
|
|
dashedName: problem-415-titanic-sets
|
2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
|
|
|
|
|
2020-02-17 16:40:55 +00:00
|
|
|
|
如果存在一条直线恰好经过S中的两个点,则一组晶格点S称为钛酸组。
|
|
|
|
|
|
|
|
|
|
泰坦尼克集的示例是S = {(0,0),(0,1),(0,2),(1,1),(2,0),(1,0)},其中 通过(0,1)和(2,0)的通道不会通过S中的任何其他点。
|
|
|
|
|
|
|
|
|
|
另一方面,集合{(0,0),(1,1),(2,2),(4,4)}不是泰坦尼克号集合,因为穿过集合中任意两点的线也经过 通过其他两个。
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
对于任何正整数N,令T(N)为每个点(x,y)都满足0≤x,y≤N的钛酸集合S的数量。 可以验证T(1)= 11,T(2)= 494,T(4)= 33554178,T(111)mod 108 = 13500401和T(105)mod 108 = 63259062。
|
2020-02-17 16:40:55 +00:00
|
|
|
|
|
|
|
|
|
找出T(1011)mod 108。
|
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
|
|
|
|
`euler415()`应该返回55859742。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
|
assert.strictEqual(euler415(), 55859742);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler415() {
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler415();
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|
2021-01-13 02:31:00 +00:00
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|