![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 92
影子019
这个作者很懒,什么都没留下…
展开
-
统计数字问题 算法
问题描述 统计一本书页码中数字出现的频率,不存在第0页和前导0的页码。 问题思路 将一个页码分为几部分,利用递归解决 例:页码为10045 1、计算0000—9999中每个数字的频率,可用公式f(n)=10n−1f(n) = 10^{n-1}f(n)=10n−1计算其中每个数字的频率 2、1完成后,计算万位上1出现的频率,为10n10^n10n 3、因为数字中间存在0,所以要计算中间两个0出现的次数 4、将页码变为45,转至步骤1,直到页码为0 5、去除前导0所计算的次数 代码 #include &l原创 2020-05-20 23:26:49 · 679 阅读 · 0 评论 -
LightOJ - 1341 Aladdin and the Flying Carpet(唯一分解定理)
It’s said that Aladdin had to solve seven mysteries before getting the Magical Lamp which summons a powerful Genie. Here we are concerned about the first mystery. Aladdin was about to enter to a magi...原创 2018-09-04 13:46:34 · 163 阅读 · 0 评论 -
LightOJ - 1370 Bi-shoe and Phi-shoe (素数筛&欧拉)
Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go...原创 2018-09-04 14:01:57 · 129 阅读 · 0 评论 -
2018ICPC南京赛区网络预赛A: An Olympian Math Problem
Alice, a student of grade 66, is thinking about an Olympian Math problem, but she feels so despair that she cries. And her classmate, Bob, has no idea about the problem. Thus he wants you to help him....原创 2018-09-02 11:02:54 · 154 阅读 · 0 评论 -
HDU1010 Tempter of the Bone(DFS+奇偶剪枝)
题目来源 HDU1010 Tempter of the Bone Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie c...原创 2018-09-11 23:10:58 · 130 阅读 · 0 评论 -
2018ICPC徐州赛区网络预赛I: Characters with Hash
Mur loves hash algorithm, and he sometimes encrypt another one’s name, and call him with that encrypted value. For instance, he calls Kimura KMR, and calls Suzuki YJSNPI. One day he read a book about ...原创 2018-09-10 11:09:37 · 199 阅读 · 0 评论 -
2018ICPC徐州赛区网络预赛G:Trace
题目来源 ACM-ICPC 2018 徐州赛区网络预赛G题(计蒜客) There’s a beach in the first quadrant. And from time to time, there are sea waves. A wave (x,y)(x,y)( x , y ) means the wave is a rectangle whose vertexes are (0,0...原创 2018-09-10 12:18:17 · 287 阅读 · 0 评论 -
hdu1015 Safecracker(暴力求解)
题目来源: hdu1015 Safecracker Problem Description === Op tech briefing, 2002/11/02 06:42 CST === “The item is locked in a Klein safe behind a painting in the second-floor library. Klein safes are ext...原创 2018-09-13 18:52:01 · 170 阅读 · 0 评论 -
POJ-2251 Dungeon Master(三维空间BFS)
题目来源: POJ-2251 Dungeon Master Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It tak...原创 2018-09-27 14:23:08 · 177 阅读 · 0 评论