![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
紫书
文章平均质量分 79
WE xiye
心有猛虎 细嗅蔷薇
展开
-
Yet Another Multiple Problem ( BFS还原 被除数(倍数))
题目链接题目: uva 1653题目大意: 给出一个数字n,和m个数字要求求出在不含有 这m个数字的情况下,n的最小倍数 !思路利用BFS 算法,模拟除法操作,还原出相应的倍数!具体操作起初在 BFS队列中 推入一个0,表示除法操作中的一次余数根据模拟除法操作,余数会*10 + 被除数下一位的数字 组成一个新的被除数如图先用 8%7 会得到余数 1余数 1会 *10 然后 加上 8 的下一位数字(0) 组成一个新的被除数 10枚举答案我们通过枚举 0-9的十个数字 一位一位的构原创 2021-11-18 17:40:00 · 302 阅读 · 1 评论 -
Circum Triangle(圆上三角形)
UVA 11186题目大意:给出一个圆,在圆上有n个点,给出每个点的角度(相当于坐标)求出每三个点围成的面积之和!分析给出点的数量是500,最简单的思路就是三层for循环直接枚举三个点然后求和但是这样会超时,所以必须要想办法优化!我们就要利用 所有的点,都在圆上这一信息!图解如果现在拿出三个点 i ,j ,k 组成一个三角形那么 Sijk 有如下关系那么就说明不管 k是在左边还是右边,都需要 减去Sijo当k在中间时,则需要 加上 Sijo所以我们可以对 所有的点 按照 弧度大小原创 2021-11-17 17:38:16 · 502 阅读 · 0 评论 -
紫书第7章-暴力dfs
暴力+dfsE-Krypton FactorL-Power CalculusE-Krypton FactorDescriptionYou have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physical abilities. In one section of the contest the contestants原创 2021-07-29 03:00:22 · 221 阅读 · 0 评论 -
紫书第6章 数据结构基础 例题(E-H)
数据结构基础 例题E-HH-TreeG-Trees on the levelF- Dropping BallsE-Self-AssemblyH-TreeDescriptionYou are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf原创 2021-07-25 01:08:48 · 3779 阅读 · 0 评论 -
第N个lunlun数!
定义:lunlun数:是一个所有相邻位数的差不超过1的整数例如 1234 5678 454 343 321 54567 等等等题目大意:现在给你一个整数 N,要求输出第 N个lunlun数其中 N<=10000分析:这个题如果使用暴力的做法枚举每一个数字,第10000个lunlun已经超过了10位,时间上卡不过去。现在在这里分享一个AC的做法:首先我们先大致找一下lunlun数的规律如果 abc是一个3位lunlun数如果 a取3,那么b只能取 2 3 4,然后再分别根据b取2 3原创 2021-06-13 02:24:40 · 423 阅读 · 0 评论 -
紫书:The Dole Queue
看起来简单,实际上一堆细节的一道题!DescriptionIn a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applicants will be placed in a large circle, facing inwards. S原创 2021-05-22 15:25:59 · 135 阅读 · 0 评论