自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 pip install uwsgi失败记录:报错 gcc: error: ~/libpython3.8.a: No such file or directory

环境:阿里云ubuntu20.04服务器,使用anaconda配置完成虚拟环境。conda install -c conda-forge uwsgi 即可解决。大概是GCC出问题了,少了点环境。

2023-04-07 19:14:05 1246 1

原创 CF-gym-102956训练周记(C,D,G,I,J,M,N)

cf地址题解先写我切(补)的,这场有点手生(都怪辣鸡实训)C. Brave Seekers of Unicorns-dp+位运算题意:给定数字n,现从1至n,选择若干整数(正序)组成数组,要满足数组{ak}中任意位置 :ai^ a(i+1) ^a(i+2)!=0求共有多少种取法(mod 998244353,n数量级1e6)题解:先想到用dp[i]记录到i(数字)共有多少种选法假设现在选择i,j,k,使得i>j>k,从中选出所有满足 i^ j^ k !=0,可以转化为选择所有i

2021-06-08 19:54:29 452

原创 CF1523 D bitset+暴力枚举(dfs)

cf题目William is hosting a party for n of his trader friends. They started a discussion on various currencies they trade, but there’s an issue: not all of his trader friends like every currency. They like some currencies, but not others.For each William’s

2021-06-01 15:53:27 204

原创 河南省第十三届ICPC-E 思维(大风车)

牛客题目选定某一位演员x,并确定棍子箭头的指向,让这位演员拿着棍子,使得除他之外没有其他演员接触棍子。然后表演开始。表演进行时,拿着棍子的演员a会顺时针旋转,当棍子碰到另外一位演员b时,演员b会接过棍子并继续旋转。为了节目效果,导演艾洛想找某一位特定的演员和在棍子上箭头的指向,当箭头旋转180°后,会回到最初那位演员手里。箭头的指向需要用(dx,dy)来表示,其中dx,dy均为整数。为了节目效果,副导演布丁得知演员的数量以及他们的位置后。需要判断能否满足艾洛的条件。如果能,告诉艾洛选择的演员和箭头

2021-05-31 15:10:50 116

原创 河南省第十三届ICPC-C 数据结构STL

牛客地址Alice和Bob在玩游戏。游戏一共有m轮,Alice手里有一个长度为n的序列a,和常数K,每一轮游戏,Alice会从序列中取出一个连续区间 [L,R]给Bob,问Bob这个区间中存在多少个连续子区间满足,区间中不同的数的个数不小于K。Bob全部回答正确了则Bob赢,否则是Alice赢。现在你需要帮助Bob赢得游戏。题意:求区间内存在多少个连续子区间满足其中不同的数大于等于K个数量级1e5题解:一开始看到区间内不同的数大于等于K个,可以用set维护某区间内不同的数出现的位置,保证se

2021-05-31 14:48:16 218 1

原创 河南省第十三届ICPC-B-水题()

牛客地址小F最近在研究蜂巢,如下图所示,这是一个蜂巢的横剖图,每一个格子都是一个正六边形,多个格子平铺构成一个无限大的平面。我们以中央的格子作为原点,按照下图规律,一圈一圈向外将每个格子都编上号。小F想知道,如果一个蜜蜂当前在编号为x的格子处,它想到达编号为y的格子,最优情况下它最少需要经过多少个格子(包含起点终点)。蜜蜂在蜂巢里只能爬行,也就是说它每次只能爬到相邻的格子里。你需要支持多组询问。题意:题目写得很明白()题解:直接建坐标系,六边形有三个轴,任选其中两个轴建系即可(某憨憨不想写太

2021-05-31 14:34:49 168

原创 CF1529 B-F 疲惫补题

cf地址B Sifid and Strange Subsequences题意:给定一组数据,找出其中最长的子序列,使得子序列中两不相同数的差值的最小值,大于等于子序列的最大值题解:水题,排序后遍历记录最小差值,直到遇到大于这个值的数,停止收录即可。代码:#include<iostream>#include<algorithm>#include<cstdio>using namespace std;typedef long long ll;const

2021-05-27 20:52:18 104

原创 CF1527 C-水题

题目The weight of a sequence is defined as the number of unordered pairs of indexes (i,j) (here i<j) with same value (ai=aj). For example, the weight of sequence a=[1,1,2,2,1] is 4. The set of unordered pairs of indexes with same value are (1,2), (1,5),

2021-05-21 10:28:07 146

原创 CF gym 101177-E-思维+建图

cf题目Problem EElection FrenzyTime limit: 10 secondsSource: Reboot WikiChecks and balances are some of the most important parts of any democratic government system. After a long campaign, the election betweenPhong, from the Sprites Party, and Megabyte

2021-05-17 20:11:11 201

原创 CF-gym-103405-Island Tour-思维

Island TourIceland by Irena Jackson, CC0 Public DomainTijmen, Annemarie and Imme are visiting Iceland, a beautiful island country located in the middle of the AtlanticOcean. To see as much of the island as possible, they wouldlike to visit all of the

2021-05-10 16:16:54 115

原创 CF-gym-103055-Shortest Path Query-最短路+位运算+树

There is an undirected graph with n vertices and m edges. The vertices are labelled by 1,2,…,n. The i-th edge connects the ui-th vertex and the vi-th vertex, the length of which is wi. Here, ui’s binary representation is always a prefix of vi’s binary repr

2021-05-10 16:04:40 408

原创 CF1509-E---组合数学

Seiji Maki doesn’t only like to observe relationships being unfolded, he also likes to observe sequences of numbers, especially permutations. Today, he has his eyes on almost sorted permutations.A permutation a1,a2,…,an of 1,2,…,n is said to be almost sor

2021-04-27 16:04:47 116

原创 CF1517.D---dp

You are wandering in the explorer space of the 2050 Conference.The explorer space can be viewed as an undirected weighted grid graph with size n×m. The set of vertices is {(i,j)|1≤i≤n,1≤j≤m}. Two vertices (i1,j1) and (i2,j2) are connected by an edge if an

2021-04-27 15:53:45 178

原创 CF1516-D---rmq+dp(st表)

This time Baby Ehab will only cut and not stick. He starts with a piece of paper with an array a of length n written on it, and then he does the following:he picks a range (l,r) and cuts the subsegment al,al+1,…,ar out, removing the rest of the array.he

2021-04-22 15:23:26 170

原创 CF1514C---数论

Now you get Baby Ehab’s first words: “Given an integer n, find the longest subsequence of [1,2,…,n−1] whose product is 1 modulo n.” Please solve the problem.A sequence b is a subsequence of an array a if b can be obtained from a by deleting some (possibly

2021-04-20 15:56:11 148

原创 CF-gym102966-H---组合数学

Malva the marshmallow adopted a group of N super-smart hamsters. Since Malva is super responsible, he keeps a strict quarantine and has plenty of time at home. In the middle of his boredom, Malva came up with an idea: he would train his hamster friends!Af

2021-04-19 10:42:58 303

原创 CF1493D. GCD of an Array---数论+multiset

You are given an array a of length n. You are asked to process q queries of the following format: given integers i and x, multiply ai by x.After processing each query you need to output the greatest common divisor (GCD) of all elements of the array a.Sin

2021-04-08 11:42:27 86

原创 CF 1484-E Skyline Photo---单调栈+线段树

参考引用——大佬题解Alice is visiting New York City. To make the trip fun, Alice will take photos of the city skyline and give the set of photos as a present to Bob. However, she wants to find the set of photos with maximum beauty and she needs your help.There are

2021-03-25 18:22:45 311

原创 CF1501 D ---数论(excrt+二分)

Vasya is a CEO of a big construction company. And as any other big boss he has a spacious, richly furnished office with two crystal chandeliers. To stay motivated Vasya needs the color of light at his office to change every day. That’s why he ordered both

2021-03-18 13:14:34 284

原创 CF 1496.F BFS Tree---生成树+最短路

We define a spanning tree of a graph to be a BFS tree rooted at vertex s if and only if for every node t the shortest distance between s and t in the graph is equal to the shortest distance between s and t in the spanning tree.Given a graph, we define f(x

2021-03-16 15:44:25 203

原创 CF 466.D---dp+组合数学

Peter has a sequence of integers a1, a2, …, an. Peter wants all numbers in the sequence to equal h. He can perform the operation of “adding one on the segment [l, r]”: add one to all elements of the sequence with indices from l to r (inclusive). At that, P

2021-03-15 20:10:41 122

原创 CF 651.E-Table Compression---进阶并查集

Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many others. Inspired by the new knowledge, Petya is now developing the new compression algorithm which he wants to name dis.Petya decided to compre

2021-03-15 17:07:03 107

原创 CF 455 D.Serega and Fun---分块+双端队列

Serega loves fun. However, everyone has fun in the unique manner. Serega has fun by solving query problems. One day Fedor came up with such a problem.You are given an array a consisting of n positive integers and queries to it. The queries can be of two t

2021-03-15 16:07:25 402

原创 CF 455. C---并查集+树的直径

Andrew plays a game called “Civilization”. Dima helps him.The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a single (unique) path, or there is no path at all. A path is such a

2021-03-15 12:20:05 154

原创 CF-327 C.Magic Five---快速幂+组合数学

There is a long plate s containing n digits. Iahub wants to delete some digits (possibly none, but he is not allowed to delete all the digits) to form his “magic number” on the plate, a number that is divisible by 5. Note that, the resulting number may con

2021-03-14 20:10:03 81

原创 CF-189 E. Weak Memory---二分+动态更新最短路

Zart PMP is qualified for ICPC World Finals in Harbin, China. After team excursion to Sun Island Park for snow sculpture art exposition, PMP should get back to buses before they leave. But the park is really big and he does not know how to find them.The p

2021-03-14 19:48:14 97

原创 CF1491-E Fib-Tree---斐波那契数性质+分治构造

Let Fk denote the k-th term of Fibonacci sequence, defined as below:F0=F1=1for any integer n≥0, Fn+2=Fn+1+FnYou are given a tree with n vertices. Recall that a tree is a connected undirected graph without cycles.We call a tree a Fib-tree, if its number

2021-03-14 19:36:27 170

原创 CF1494-D Dogeforces---并查集+stl构造

The Dogeforces company has k employees. Each employee, except for lower-level employees, has at least 2 subordinates. Lower-level employees have no subordinates. Each employee, except for the head of the company, has exactly one direct supervisor. The head

2021-03-14 19:19:59 116

原创 Wi Know---线段树辅助+前向星查找

Wi KnowYou are the boss of Wi Know, an upstanding company in information theory, especially in message encryption.The counter-counter-intelligence branch of your upstanding company managed to intercept a message sent by the counter-intelligence agency of

2021-03-14 19:01:19 125

原创 Conveyor belts---流+分点建图

Conveyor beltsYour factory has N junctions (numbered from 1 to N) connected by M conveyor belts. Each conveyor belt transports any product automatically from one junction to another junction in exactly one minute. Note that each conveyor belt only works i

2021-03-14 18:39:42 4328

空空如也

空空如也

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

TA关注的人

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