Gabriel Wu
Gabriel Wu
> 最后一题用线段树是不是时间复杂度更低一些? 是的呀,不过线段树的做法需要欧拉序+离线查询,需要的前置知识还是挺多的。
> 请问下,为啥我没有登录时,公式编排显示有重复和乱码? 之前没有遇到过这个情况,不太清楚具体的原因。
像第二题这样的,完全可以扩大数据范围,变成Hard,但最后却沦为了签到题,不得不说是一种浪费。
第三题一开始没想到倒推,实在是……太愚蠢了。
第四题比赛时判环的条件还写错了……要不是这题有特殊性(环长度至少为4),还得吃一发WA。
@swapno7064 I have added an example.
@heyuhhh Because in the future, we can never use numbers less than $a_{i+1}$. So if the current value cannot be divided by $a_{i+1}$, it will never become 0.
@swapno7064 Note that for each number in the intermediate transitions, there is a count of different ways to reach that number.
@swapno7064 The coefficients can be negative.
Why not reuse some existing package, e.g., https://github.com/wezm/titlecase?