2020暑期牛客多校第一場F.Infinite String Comparision(無限循環字符串比較字典序)

題目連接:https://ac.nowcoder.com/acm/contest/5666/F 解題思路: 轉自https://www.cnblogs.com/fate-/p/13299779.htmlhtml 不是很理解,反正記住兩個字符串a和b,長度分別爲p和q,那麼比較p+q-gcd(p,q)次,就能夠獲得a∞ 和b∞ 的字典序大小比較ios #include<iostream> #incl
相關文章
相關標籤/搜索