自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 【无标题】

栈与公约数

2022-10-24 18:59:25 235 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 88

原创 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 92

原创 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 99

原创 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 78

原创 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 91

原创 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 78

原创 Heavy Transportation

BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his customer has build his giant steel crane to the place where

2021-08-02 18:12:03 56

原创 codeforces gym 102801

Now there are K people play Halli Galli game.They will play N turns in all,in the order of the first player,the second player,⋯,the K player,the first player,⋯.In one turn,the player will display a card on his side,if there are a kinds of fruit which its

2021-08-02 16:16:10 162

原创 Road blocks 次短路

次短路问题关于队列优先级#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<queue>#include<vector>using namespace std;const int inf=0x3f3f3f3f;const int N=100005;typedef pair<int,int> P;t

2021-08-02 15:34:01 111

原创 01背包 + 完全背包

01背包问题;题目链接[https://www.acwing.com/problem/content/2/]题目大意:就是说给你一个容量为vv的背包 让你在n种物品中选取装入背包中 使得装入背包里的物品价值最大 每种物品只有一个;用我们队长的话来说 这是最朴实的写法#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>using namespace std;

2021-08-01 16:35:48 79

原创 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 56

原创 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 114

原创 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 63

原创 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 63

原创 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 51

原创 洛谷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 90

原创 洛谷P2249

https://www.luogu.com.cn/problem/P2249关于简单的二分题目点链接#include#include#include#includeusing namespace std;const int N=1000000;int n,m,a[N],x,b[N];int findnum(int x){ int l=1,r=n,mid;while(l<r) {mid=(l+r)/2;if(a[mid]>=x)r=mid;elsel=

2021-05-21 20:17:37 250

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除