- 博客(16)
- 收藏
- 关注
原创 算法补全计划-算法堆
**把算法补全计划里提上日程的算法放进本篇堆内,已经完成的的弹出,给自己画饼 **算法堆图论-最短路-spfa搜索-dfs序计算几何-凸包图论-链式前向星已出堆2020/11/8 图论-最短路-Dijkstra2020/11/8 图论-最短路-floyd...
2020-11-09 23:03:53 137
原创 算法补全计划(慢慢更新)
写在前面的话从我接触到acm以来已经过了一年了,这一年中间也算发生了很多事情,我很感谢对我给予了诸多帮助的学长和同级们,让我算是一只脚踏进了这个领域。但是这一年来我并没有去主动学习到很多的东西,尤其是算法方面,现在的我只能算是一个纯纯的小白,我不希望这份将懒惰留到未来,让我的队友和我留下遗憾(两个月前我有幸和学长一起参加陕西省赛,但是我们的成绩很不好,当时看到他们的失望神情真的很难受)。今天我在翻以前的队内资料,偶然看到一个很久以前的纳新文件,里面有一张记录了大部分算法的图,因此我决定写下这篇博客,将上面
2020-11-03 22:33:53 2367 2
原创 算法补全计划 计算几何-凸包
凸包凸包是计算几何中最基础的一部分,第一次听到这个名字可能会不知道它是做什么的,但该算法其实并不复杂。凸包定义为在一个实数向量空间V中,对于给定集合X,所有包含X的凸集的交集S被称为X的凸包。简单来讲就是在一个坐标系中有n个点,用一个橡皮筋套住最外面的所有点,使其包住这所有n个点形成的凸多边形就是凸包在学习凸包之前,先了解几个几何中的基础概念1.叉积在二维平面中存在两个向量p1(x1,y1)和p2(x2,y2),p1*p2 = x1 * y2 - x2 * y1。对于叉积有这样一个性质
2020-11-12 22:11:41 221
原创 算法补全计划 图论-最短路-Dijkstra
Dijkstra算法Dijkstra算法用于寻找顶点到其他点的最短路,复杂度为O(n2),可以通过优先队列优化成O(nlogn)的复杂度,且该算法无法解决带有负边权的问题。该算法的主要思想为贪心。首先建立数组dis[n]和集合T,数组dis表示每个点到顶点的已知最短距离,初始为顶点可以直接到达的点的dis为直接连边的边权,不可以直接到达的点的dis为无限大,集合T初始为空。每次选择一个点i(第一次选择顶点),将其放入集合T,然后找到距离该点最近的一个点j,这个点就是到达该点的最优途径(如果存在负边权,
2020-11-08 19:46:50 208
原创 算法补全计划 图论-最短路-floyd
Floyd算法(Floyd-Warshall)Floyd算法用来找出一个图中任何两个点的最短路径,复杂度为O(n¬3),大体思路为通过考虑i点到j点的当前最短距离dij与i点到k点的最短距离加k点到j点的最短距离dik+dkj来进行比较,并不断更新dij来求出图中任意两点的最短路。该算法通常仅在点数少于300时使用,除去可以求除任意两点间最短路外,该算法还可以用来判断图的连通性。板子#include<iostream>#include<string.h>using na
2020-11-08 18:31:16 163
原创 2020ICPC亚洲网上区域赛模拟赛总结及部分题解
总结虽然是网络赛,但这是我们这支新组的队伍第一次一起打比赛,感觉配合上还是十分生疏,尤其是读题上,B题足足花了五十分钟才读明白到底是什么意思(离谱)。开局三个人一起看了一眼A,题目很短基本上几秒钟就看懂什么意思,然后一个队友开始想A,我看了一眼榜,发现有个队伍17秒秒杀了B(更离谱了),发现这题真长的离谱,然后我叫另外一个队友研究这道题到底啥意思,中间把A切了,于是就变成了我们三个一起研究这题啥意思。。终于在五十分钟的时候终于看懂了(英语不行是这样的),在纸上模拟了几种情况,发现大部分情况都只输出2就行
2020-11-01 17:23:50 5688 15
原创 计蒜客 - 41099 Reversion Count(找规律)
题目链接计蒜客 - 41099题目There is a positive integer X, X’s reversion count is Y. For example, X=123, Y=321; X=1234, Y=4321. Z=(X-Y)/9, Judge if Z is made up of only one number(0,1,2…9), like Z=11,Z=111,Z=222,don’t consider '+'and ‘-’.Input:Input contains of
2020-10-29 22:31:40 176
原创 HDU - 6558 The Moon(概率dp)
题目The Moon card shows a large, full moon in the night’s sky, positioned between two large towers. The Moon is a symbol of intuition, dreams, and the unconscious. The light of the moon is dim, compared to the sun, and only vaguely illuminates the path to
2020-10-27 23:28:14 272
原创 HDU - 6557 Justice
题目Put simply, the Justice card represents justice, fairness, truth and the law. You are being called to account for your actions and will be judged accordingly. If you have acted in a way that is in alignment with your Higher Self and for the greater good
2020-10-26 23:25:18 207
原创 Codeforces Round #677 (Div. 3)部分题解(除G)
题目1433A Boring Apartments1433B Yet Another Bookshelf1433C Dominant Piranha1433D Districts Connection1433E Two Round Dances1433F Zero Remainder Sum1433A Boring Apartments题目There is a building consisting of 10 000 apartments numbered from 1 to 10 000, inc
2020-10-25 19:36:32 664
原创 计蒜客 - 42382 So Easy(ICPC 2019 银川B)(签到)
题目Mr. G invents a new game whose rules are given as follows.Firstly, he has a n×n matrix, all elements of which are 0 initially. Then, he follows up with some operations: in each time he chooses a row or a column, and adds an arbitrary positive integer t
2020-10-22 23:49:33 416
原创 计蒜客 - 42578 And and Pair(2019 ICPC南昌)(找规律水题)
题目Given an extremely large non-negative integer n, you are asked to count the number of pairs (i,j) of integers satisfying the following conditions:0≤j≤i≤n;i & n=i; andi & j=0.Here & represents the bitwise AND operator.For simplicity, the
2020-10-21 20:20:30 395
原创 计蒜客 - 42580 Bob‘s Problem(ICPC2019 南昌站)
题目Bob was in trouble.He rubbed the magic ring on his finger, and you came out of the ground.You are given an undirected graph G which contains n vertices labelled from 1 to n, with m weighted edges between them coloured in black or white.You have to choo
2020-10-20 20:32:31 534
原创 Gym - 102433M Maze Connect(dfs)(Pacific Northwest Regional Contest 2019)
题目Given an orthogonal maze rotated 45 degrees and drawn with forward and backward slash characters (see below), determine the minimum number of walls that need to be removed to ensure it is possible to escape outside of the maze from every square of the (
2020-10-19 19:46:59 369
原创 X问题 简单数论
求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 < a[i] <= 10)。Input输入数据的第一行为一个正整数T,表示有T组测试数据。每组测试数据的第一行为两个正整数N,M (0 < N <= 1000,00...
2019-12-13 16:13:13 465 1
原创 CF #605 div.3 D Remove One Element
You are given an array a consisting of n integers.You can remove at most one element from this array. Thus, the final length of the array is n−1 or n.Your task is to calculate the maximum possible l...
2019-12-13 15:53:59 174
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人