![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
文章平均质量分 59
努力改bug的老baby
这个作者很懒,什么都没留下…
展开
-
【无标题】
栈与公约数原创 2022-10-24 18:59:25 · 223 阅读 · 1 评论 -
简单的算法模板
一、最小生成树1、prim() 算法#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;const int N=1e4+5,inf=0x3f3f3f3f;int dist[N],vis[N],map[N][N];int n,m;//m表示有m条道;int sum;void prepare(){ for(原创 2021-09-11 20:11:07 · 80 阅读 · 0 评论 -
Borg Maze prim+bfs ps(这一题我。。。。)
Borg MazeThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe the group consciousness of the Borg civilization. Each Borg individual is linked to the collectiv原创 2021-08-13 11:12:36 · 84 阅读 · 0 评论 -
The Unique MST最小生成树是否唯一 ACM Contest and Blackout次小生成树 Is There A Second Way Left?次小生成树是否存在
Given a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V’, E’), with the following properties:V’原创 2021-08-11 16:26:54 · 84 阅读 · 0 评论 -
Highways 和Arctic Network 最小生成树
The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of this problem and has already constructed a number of highways connecting some of the most important tow原创 2021-08-10 16:56:27 · 75 阅读 · 0 评论 -
Supermarket 贪心
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the sale begins. Each product takes precisely one unit of tim原创 2021-08-06 14:11:11 · 89 阅读 · 0 评论 -
Q - How Many Answers Are Wrong
TT and FF are … friends. Uh… very very good friends -________-bFF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin with, TT should write down a sequence of integers-_-!!(bored).Then, FF can c原创 2021-08-06 09:45:47 · 76 阅读 · 0 评论 -
2021-07-19
Karafs is some kind of vegetable in shape of an 1 × h rectangle. Tavaspolis people love Karafs and they use Karafs in almost any kind of food. Tavas, himself, is crazy about Karafs.Each Karafs has a positive integer height. Tavas has an infinite 1-based s原创 2021-07-23 10:27:50 · 51 阅读 · 0 评论 -
Pots bfs
PotsYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed:1.FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;2.DROP(i) empty the pot i to the drain;3.POUR(i,j) pour from pot i原创 2021-05-31 20:57:04 · 107 阅读 · 0 评论 -
2021-05-31
Find a way**Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki.Yifenfei’s home is at the countryside, but Merceki’s home is in the cente原创 2021-05-31 20:43:18 · 60 阅读 · 0 评论 -
N皇后问题
N皇后问题在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sample Input1850Sample Output19210对角线不能放 对角线关系我还是好模糊X表示行 Y原创 2021-05-24 20:32:42 · 60 阅读 · 0 评论 -
2021-05-22
这一题我是纯用lower_bound没有用到STL 但是思路都差不多#include#include#include#includeusing namespace std;const int N=1000005;int a[N],b[N],i,n,m,pos;int main(){cin>>n>>m;for(i=1; i<=n; i++)cin>>a[i];for(i=0; i<m; i++)cin>>b[i];fo.原创 2021-05-22 09:49:57 · 48 阅读 · 0 评论 -
洛谷P1102
https://www.luogu.com.cn/problem/P1102MAP 的映射将A-B=C转化为 A-C=B将每个数减C再扫一遍数组 将所有映射次数想加思路来源 https://www.luogu.com.cn/blog/TeslaZengPerez/solution-p1102(蒟蒻不会写题 只会看题解 嘤嘤嘤)上代码#include#include#include#include#includeusing namespace std;typedef long原创 2021-05-22 09:39:15 · 85 阅读 · 0 评论