自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 并查集——扩展域并查集和带权并查集

相关例题食物链D. The Number of Imposters食物链题目大意给出一种食物链,其中A吃B,B吃C,C吃A,构成一种环形食物链给出m个输入,其中包括两种输入k,x,y: 1、当k = 1时,x 和 y为同类 2、当k = 2时,表示 x 吃 y这 m 个输入中有的是假话,当满足以下三个条件之一,即为假话 1、当前的话和以前的话存在冲突 2、x 或 y 的值比n大 3、x 吃 x求这m个输入中有多少假话方法一(带权并查集):通过一个数组d来表示所有点到

2021-12-10 21:26:44 893

原创 扩展欧几里得算法证明及代码

裴蜀定理: 存在两个正整数a,b,使得a * x + b * y = gcd( a , b )证明方法(扩展欧几里得算法): 1、当 b = 0 时 gac( a , b ) = a 易知 x = 1,y = 0,使得a * x + b * y = 0 2、当b != 0 时 gcd( a , b ) = gcd( b , a % b);------------------------1 假设 a * x + b * y = gcd( a , b );-------------

2021-12-06 19:22:26 535

原创 WFU校赛题解 B、C、F

problem B:解题代码:#include <iostream>#include <algorithm>#include <queue>#include <cstring>#define LL long longusing namespace std;const int N = 1e5 + 10;int ne[2*N],e[2*N],h[N],dis[N],st[N],w[2*N],arr[N];int n,m,idx,k;

2021-12-06 11:32:52 158 2

原创 亚洲区域赛济南站热身赛A题

过题代码:#include <iostream>using namespace std;int a[65],b[65],sg[65],c[65];int main(void){ int n; cin >> n; for(int i=0;i<n;i++) cin >> sg[i]; for(int i=0;i<n;i++) cin >> a[i];

2021-11-13 20:45:18 736

原创 Codeforces Round #676 (Div. 2) B

B. Putting Bricks in the Wall原题链接题面Pink Floyd are pulling a prank on Roger Waters. They know he doesn’t like walls, he wants to be able to walk freely, so they are blocking him from exiting his room which can be seen as a grid.Roger Waters has a square

2021-03-28 20:22:09 103

原创 Codeforces Round #709 (Div. 2) B

B. Restore Modulo原题链接题面For the first place at the competition, Alex won many arrays of integers and was assured that these arrays are very expensive. After the award ceremony Alex decided to sell them. There is a rule in arrays pawnshop: you can sell ar

2021-03-23 21:11:46 159 4

原创 Educational Codeforces Round 106 (Rated for Div. 2) A

A. Domino on Windowsill原题链接题面You have a board represented as a grid with 2×n cells.The first k1 cells on the first row and first k2 cells on the second row are colored in white. All other cells are colored in black.You have w white dominoes (2×1 tiles

2021-03-19 08:48:52 175

原创 Codeforces Round #708 (Div. 2) A

A. Meximization原题链接题面You are given an integer n and an array a1,a2,…,an. You should reorder the elements of the array a in such way that the sum of MEX on prefixes (i-th prefix is a1,a2,…,ai) is maximized.Formally, you should find an array b1,b2,…,bn,

2021-03-19 08:30:47 100

原创 Codeforces Round #707 (Div. 2)B - Napoleon Cake

原题链接题面This week Arkady wanted to cook some pancakes (to follow ancient traditions) and make a problem about that. But then he remembered that one can’t make a problem about stacking pancakes without working at a specific IT company, so he decided to bake

2021-03-14 21:09:45 556

原创 Codeforces Round #707 (Div. 2) A - Alexey and Train

原题链接A. Alexey and Train题面Alexey is travelling on a train. Unfortunately, due to the bad weather, the train moves slower that it should!Alexey took the train at the railroad terminal. Let’s say that the train starts from the terminal at the moment 0. Al

2021-03-14 20:51:21 278

原创 Educational Codeforces Round 105 (div 2) A

Educational Codeforces Round 105 (div 2) AA. ABC String原题链接题面You are given a string a, consisting of n characters, n is even. For each i from 1 to n ai is one of ‘A’, ‘B’ or ‘C’.A bracket sequence is a string containing only characters “(” and “)”. A

2021-03-03 21:09:54 88 4

空空如也

空空如也

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

TA关注的人

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