• 2024-12-16(补题)Codeforces Round 993 (Div. 4) E.Insane Problem
    显然不可暴力解出,因此是到数学题。已知$$y=x*k^n$$所以我们可以利用y的区间范围$$[l1,r1]$$得出x的新的区间范围$$[l2/k^n(向上取整),r2/k^n(向下取整)]$$接着与原来的范围取交集然后不断枚举n即可,注意k^n不可能超过y#include<iostream>#defineintlonglongusingnamespa
  • 2024-12-16Insane Problem(思维)
    Waveisgivenfiveintegers\(k\),\(l_1\),\(r_1\),\(l_2\),and\(r_2\).Wavewantsyoutohelphercountthenumberoforderedpairs\((x,y)\)suchthatallofthefollowingaresatisfied:\(l_1\leqx\leqr_1\).\(l_2\leqy\leq