跳到正文

Wind_Smiled

740157

风颜悦。颜悦因风起,风起故颜悦。||向着不同的方向、我们逐渐远去、背对背的你我、难能再见||这个OP的 uid:266896259

在洛谷打开
资料、奖项与版本

资料

编号
740157
抓取

lower_bound(begin,end,num,greater<type>()) :从数组的 begin 位置到 end-1 位置二分查找第一个大于或等于 num 的数字,找到返回该数字的地址,不存在则返回 end。通过返回的地址减去起始地址 begin ,得到找到数字在数组中的下标。

upper_bound(begin,end,num,greater<type>()) :从数组的 begin 位置到 end-1 位置二分查找第一个大于 num 的数字,找到返回该数字的地址,不存在则返回 end。通过返回的地址减去起始地址 begin,得到找到数字在数组中的下标。

I/O效率

OI Wiki

LaTeX大标准库\LaTeX大标准库

LaTeX\LaTeX题解常用足够了

LaTeX\LaTeX原网站

Markdown 题解标注

再见,fAKe 侠

试图进入主页精简计划(

粉丝福利

云存档代码(确信

2022.10.20 19:20 未知原因,上线后发现咕值更新了??还加了9点诶

2022.12.5 7:01 咕值排名第500名了

咕值max咕值_{max}

咕值now咕值_{now}

『且遇黑夜』— And in the dark —\color{#2CA9E1}\mathsf{『且遇黑夜』}\\\scriptsize\mathsf{— \ And \ in \ the \ dark \ —} 『视天上星隐星现』— Look at the twinking star in the sky —\color{#2CA9E1}\mathsf{『视天上星隐星现』}\\\scriptsize\mathsf{—\ Look \ at \ the \ twinking \ star \ in \ the \ sky \ —} 『恰逢白昼』— Fall into the daylight —\color{#2CA9E1}\mathsf{『恰逢白昼』}\\\scriptsize\mathsf{—\ Fall \ into \ the \ daylight \ —} 『闻身后风起风息』— Found the wind blowing behind me —\color{#2CA9E1}\mathsf{『闻身后风起风息』}\\\scriptsize\mathsf{— \ Found \ the \ wind \ blowing \ behind \ me \ —} 『宠辱不惊』— It is easy to be flattered —\color{#2CA9E1}\mathsf{『宠辱不惊』}\\\scriptsize\mathsf{—\ It \ is \ easy \ to \ be \ flattered \ —} 『看庭前花开花落』— Watch the front flowers bloom and fall —\color{#2CA9E1}\mathsf{『看庭前花开花落』}\\\scriptsize\mathsf{—\ Watch \ the \ front \ flowers \ bloom \ and \ fall \ —} 『去留无意』— Have no intention of staying or going —\color{#2CA9E1}\mathsf{『去留无意』}\\\scriptsize\mathsf{—\ Have \ no \ intention \ of \ staying \ or \ going \ —} 『望空中云卷云舒』— Look at the cloud in the sky —\color{#2CA9E1}\mathsf{『望空中云卷云舒』}\\\scriptsize\mathsf{—\ Look \ at \ the \ cloud \ in \ the \ sky \ —} 『一生一期』— One lifetime —\color{#2CA9E1}\mathsf{『一生一期』}\\\scriptsize\mathsf{—\ One \ lifetime \ —} 『忆往事挥汗挥泪』— Sweet and cry over the past —\color{#2CA9E1}\mathsf{『忆往事挥汗挥泪』}\\\scriptsize\mathsf{—\ Sweet \ and \ cry \ over \ the \ past \ —} 『此生难会』— A rare meeting in my life—\color{#2CA9E1}\mathsf{『此生难会』}\\\scriptsize\mathsf{—\ A \ rare \ meeting \ in \ my \ life—} 『追心梦艰难艰险』— The pursuit of heart dreams is difficult and dangerous —\color{#2CA9E1}\mathsf{『追心梦艰难艰险』}\\\scriptsize\mathsf{—\ The \ pursuit \ of \ heart \ dreams \ is \ difficult \ and \ dangerous \ —} 『但不畏惧』— But not afraid —\color{#2CA9E1}\mathsf{『但不畏惧』}\\\scriptsize\mathsf{—\ But \ not \ afraid \ —} 『感心中光明光亮』— Feel the light in my heart —\color{#2CA9E1}\mathsf{『感心中光明光亮』}\\\scriptsize\mathsf{—\ Feel \ the \ light \ in \ my \ heart \ —} 『放眼未来』— Look to the future —\color{#2CA9E1}\mathsf{『放眼未来』}\\\scriptsize\mathsf{—\ Look \ to \ the \ future \ —} 『寻明日希冀希望』— Looking for tomorrow to hope for —\color{#2CA9E1}\mathsf{『寻明日希冀希望』}\\\scriptsize\mathsf{—\ Looking \ for \ tomorrow \ to \ hope \ for \ —}

背景

console.log(_feInstance.currentData.user.introduction) 屑屑你(

$\rule{60pt}{28pt}\kern{-46pt}\color{white}\raisebox{10pt}{\footnotesize\sf 回到顶部 }$$

$\rule{60pt}{28pt}\kern{-38pt}\color{white}\raisebox{10pt}{\footnotesize\sf 收起 }$$

$\rule{60pt}{28pt}\kern{-38pt}\color{white}\raisebox{10pt}{\footnotesize\sf 刷新 }$$

共 1 篇
  1. 题解

    P5991 [PA2015]Równanie

    该问题要求找出满足 a ≤ n ≤ b 且 k × f(n) = n 的正整数 n 的个数,其中 f(n) 是 n 的各位数字平方和。由于直接枚举 n 会超时,因此采用优化策略: 关键观察:若 k × f(n) = n,则 n = k × i(其中 i = f(n))。由于 f(n) 的最大值为 9^2 × 18 = 1458(当 n 为 18 位全 9 数时),因此只需枚举 i 的范围为 1 到 1458。 算法步骤: 枚举 i 从 1 到 1458,计算 n = i × k。 若 n ≤ b 且 f(n) = i,则 n 是候选解。 但需排除 n < a 的情况,因此统计所有 i × k ≤ a-1 且 f(n) = i 的情况,并从总数中减去。 复杂度:枚举 i 的范围仅为 1458 次,每次计算 f(n) 的时间复杂度为 O(1)(因数字位数最多 18 位),整体时间复杂度极低,可高效处理大范围数据。 结论:通过限制 i 的范围并利用数学性质,将问题转化为枚举 i 的小规模计算,最终答案为满足条件的 i 的数量,其中 n = i × k 在 [a, b] 区间内。

    5 赞