
codeforces
文章平均质量分 78
A_Akira_K
这个作者很懒,什么都没留下…
展开
-
并查集——扩展域并查集和带权并查集
相关例题食物链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 · 947 阅读 · 0 评论 -
亚洲区域赛济南站热身赛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 · 782 阅读 · 0 评论 -
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 · 135 阅读 · 0 评论 -
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 · 262 阅读 · 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 · 222 阅读 · 0 评论 -
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 · 129 阅读 · 0 评论 -
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 · 621 阅读 · 0 评论 -
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 · 318 阅读 · 0 评论