※ 引述《runtime ()》之銘言:
: 我是路人甲~
: 昨天的題目 第一題就超時了
其實第一題不會太難
首先觀察一個現象
csod(10)
2 exist in sod(4), sod(6), sod(8), sod(10) -> 5-1 times
3 exist in sod(6), sod(9) -> 3-1 times
4 exist in sod(8) -> 2-1 times
5 exist in sod(10) -> 2-1 times
6 or more can't contribute to csod(10)
應該可以自行觀察出關係吧
但是這樣是不夠的,再來考慮
csod(100)
times| 2| 3| 4| 5| 6| 7| 8| 9|10|11|12|14|16|20|25|33|50|
---------------------------------------------------------
range|50|33|25|20|16|14|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2|
表格說明
range 100-51 contribute nothing
50-34 contribute 2-1 times
33-26 contribite 3-1 times
................
值得注意的是在 sqrt(100)(也就是10)的左右兩端是點對稱
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.250.176