Skip to content

Commit a9a1ca8

Browse files
committed
docs: fix wrong link
1 parent 2a63aa5 commit a9a1ca8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/algorithm-stories.md

+13
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,18 @@ boolean isLeapYear(int year) {
112112

113113
不过,**年份跨越世纪时,康威列表就会失去作用**
114114

115+
题目中问的是 2199.7.2 的星期,如果不能得知 2199 年“末日”是星期几,那么这道题很难求解。对于不同世纪的年份,没有什么特别的方法能够猜出“末日”的星期。只能将被 100 整除的年份表示为日历形式时,得到一些规律而已。
115116

117+
||||||||
118+
|---|---|---|---|---|---|---|
119+
| 1599 | | 1600 | 1601 | 1602 | | |
120+
| 1700 | 1701 | 1702 | 1703 | | 1704 | 1705 |
121+
| | 1796 | 1797 | 1798 | 1799 | 1800 | 1801|
122+
| 1897 | 1898 | 1899 | 1900 | 1901 | 1902 | 1903 |
123+
| 1999 | | | 2000 | 2001 | 2002 | 2003|
124+
| 2100 | 2101 | 2102 | 2103 | | 2104 | 2105 |
125+
| | 2196 | 2197 | 2198 | 2199 | 2200 | 2201|
116126

127+
这道题看似简单,但其实不仅需要了解“末日”算法,还需要深入了解上述模式。上面的日历中,2199 年的“末日”是星期四,所以 2199.7.11/2911.7.4 也是星期四,所以 2199.7.2 是星期二。
128+
129+
感受到康威教授末日算法的精妙之处了吧。

0 commit comments

Comments
 (0)