自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(161)
  • 资源 (1)
  • 收藏
  • 关注

原创 LaTex 公式

加粗: $\bm{...}$更改颜色:\color{red}\color{green}\color{back}LaTex表达形式对应的符号LaTex表达形式对应的符号\alphaα\alphaα\AlphaA\AlphaA\betaβ\betaβ\BetaB\BetaB\gammaγ\gammaγ\GammaΓ\GammaΓ\deltaδ\deltaδ\DeltaΔ\DeltaΔ\epsilonϵ\epsilonϵ\E

2022-01-29 10:51:45 1847

原创 正则表达式Python版本

re模块 match 只比较开头 span 位置,group内容 search 从头开始找,只能找一次 findall 从头开始找,找多次 sub 替换 split 切割限定符use? ?前的字符可有(1个)可无us*e *前的字符可有(任意个)可无us+e +前的字符最少出现一次ab{6}c {6}前的字符只能出现6次ab{2,6}c ..

2021-03-11 20:18:08 231

原创 Hello 2019 (线段树维护矩阵实现任意区间的dp)

A digital string is "good": when it contains a subsequence91029102and does not contain a subsequence81028102.The bad value of a string is defined as how many characters are to remove at least, so...

2019-09-14 09:37:58 366

原创 AYIT-ACM实验室

AYIT-ACM简介 ACM协会为你的梦想插上翅膀。1. 本院ACM协会成立于2012年2. 2008年开始小规模参加河南省竞赛...

2019-09-03 21:57:05 5255 4

原创 Rikka with Coin(10,20,50,100组成给定任意数的最少使用量)

Rikka hates coins, and she used to never carry any coins with her. These days, Rikka is doing her summer internship abroad. Without mobile payment, Rikka has to face strange prices of commodities, and...

2019-08-20 20:25:55 222

原创 Rikka with Cake(线段树求线段之间的交点个数)

Rikka's birthday is on June 12th. The story of this problem happens on that day.Today is Rikka's birthday. Yuta prepares a big cake for her: the shape of this cake is a rectangular ofnncentimeters...

2019-08-20 20:04:36 279

原创 求和问题(线段树维护等差数列)

题目描述你现在有一个数组AA我们定义如下的两种操作:1. 修改: 形如00llrr,效果为对所有l<=i<=rl<=i<=r执行Ai+=(i−l+1)Ai+=(i−l+1)直观地说就是Al+=1,Al+1+=2,Al+2+=3...Ar+=r−l+1Al+=1,Al+1+=2,Al+2+=3...Ar+=r−l+1这个样子2. ...

2019-08-02 22:41:57 539

原创 Path(最短路 + 最大流求最小割)

Years later, Jerry fell in love with a girl, and he often walks for a long time to pay visits to her. But, because he spends too much time with his girlfriend, Tom feels neglected and wants to prevent...

2019-07-25 17:16:31 286

原创 Aragorn's Story(树链剖分+线段树或树状数组模板)

Our protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enemies who want to invade his kingdom. As Aragorn knows, the enemy has N camps ou...

2019-05-28 21:51:32 937

原创 花神游历各国(线段树,区间开平方)

题目描述原题来自:BZOJ 3211花神喜欢步行游历各国,顺便虐爆各地竞赛。花神有一条游览路线,它是线型的,也就是说,所有游历国家呈一条线的形状排列,花神对每个国家都有一个喜欢程度(当然花神并不一定喜欢所有国家)。每一次旅行中,花神会选择一条旅游路线,它在那一串国家中是连续的一段,这次旅行带来的开心值是这些国家的喜欢度的总和,当然花神对这些国家的喜欢程序并不是恒定的,有时会突然对某些国...

2019-05-20 12:45:56 392

原创 维护序列(线段树,区间加,区间乘)

题目描述原题来自:AHOI 2009老师交给小可可一个维护数列的任务,现在小可可希望你来帮他完成。有长为的数列,不妨设为。有如下三种操作形式:把数列中的一段数全部乘一个值; 把数列中的一段数全部加一个值; 询问数列中的一段数的和,由于答案可能很大,你只需输出这个数模 P的值。输入格式第一行两个整数 n和 P;第二行含有 n个非负整数,从左到右依次为 ai ;...

2019-05-20 12:34:35 611

原创 家庭作业(贪心 + 并查集)

老师在开学第一天就把所有作业都布置了,每个作业如果在规定的时间内交上来的话才有学分。每个作业的截止日期和学分可能是不同的。例如如果一个作业学分为,要求在天内交,那么要想拿到这学分,就必须在第天结束前交。每个作业的完成时间都是只有一天。例如,假设有 7 次作业的学分和完成时间如下:最多可以获得学分,其中一个完成作业的次序为,注意可能还有其他方法。你的任务就是找到一个...

2019-05-15 21:28:29 2272

原创 糖果传递 (数学+贪心)

题目描述原题来自:HAOI 2008有个小朋友坐成一圈,每人有颗糖果。每人只能给左右两人传递糖果。每人每次传递一颗糖果的代价为。求使所有人获得均等糖果的最小代价。输入格式第一行有一个整数,表示小朋友个数;在接下来行中,每行一个整数。输出格式输出使所有人获得均等糖果的最小代价。样例样例输入41254样例输出4题目...

2019-05-15 21:03:56 1250

原创 GCD and LCM (素因子分解)

Given two positive integers G and L, could you tell me how many solutions of (x, y, z) there are, satisfying that gcd(x, y, z) = G and lcm(x, y, z) = L?Note, gcd(x, y, z) means the greatest common d...

2019-04-30 20:05:06 245

原创 Counting Divisors (区间因子个数之和,区间打表)

In mathematics, the functiond(n)d(n)denotes the number of divisors of positive integernn.For example,d(12)=6d(12)=6because1,2,3,4,6,121,2,3,4,6,12are all1212's divisors.In this problem, gi...

2019-04-30 19:52:38 576

原创 Welcome Party (并查集 + 优先队列)

The 44th World Finals of the International Collegiate Programming Contest (ICPC 2020) will be held in Moscow, Russia. To celebrate this annual event for the best competitive programmers around the wor...

2019-04-28 17:28:25 659

原创 Robots (遍历树处理 ,分治)

The Robotics Olympiad teams were competing in a contest.There was a tree drawn on the floor, consisting ofnnodes andn - 1edges. The nodes are numbered from1ton, and each edge has a weight. Th...

2019-04-24 18:01:08 245

原创 最长回文(Manacher 马拉车算法模板解析)

给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组...

2019-04-23 16:40:18 436

原创 String Problem(最大最小表示法 + KMP求个数)

Give you a string with length N, you can generate N strings by left shifts. For example let consider the string “SKYLONG”, we can generate seven strings:String RankSKYLONG 1KYLONGS 2YLONGSK 3...

2019-04-23 12:19:53 218

原创 Almost Union-Find (带权值的并查集 + 分离节点 )

I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not identical.The data structure you need to write is also a collection of disjoint se...

2019-04-22 16:29:07 285

原创 Triangle(给了一系列数,判断能不能选出三个数构成三角形)

Problem DescriptionAfter Xiaoteng took a math class, he learned a lot of different shapes, but Xiaoteng's favorite triangle is because he likes stable shapes, just like his style.After the Xiaoxun...

2019-04-21 16:17:45 1182 2

原创 Subsequence (预处理,判断一个串是不是另一个串的不连续字串)

Give a stringSSandNNstringT_iTi​, determine whetherT_iTi​is a subsequence ofSS.If ti is subsequence ofSS, printYES,else printNO.If there is an array\lbrace K_1, K_2, K_3,\cdots, K_m \...

2019-04-21 15:54:23 309

原创 Max answer (求区间最小值乘区间和的最大结果,维护左右区间+st求区间最大,最小值)

Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value in the interval.Now she is planning to find the...

2019-04-21 15:09:09 2973

原创 MORE XOR (区间多次异或求值,规律)

Given a sequence ofnnnumbersa_1, a_2, \cdots, a_na1​,a2​,⋯,an​and three functions.Define a functionf(l,r)f(l,r)which returns\oplus a[x]⊕a[x](l \le x \le rl≤x≤r). The\oplus⊕represents exclu...

2019-04-21 11:31:21 634

原创 Monitor (矩阵是否完全被覆盖,二维转一维,求前缀和)

Problem DescriptionXiaoteng has a large area of land for growing crops, and the land can be seen as a rectangle ofn×m.But recently Xiaoteng found that his crops were often stolen by a group of pe...

2019-04-21 10:50:22 525

原创 大小接近的点对 (树状数组 + 离散化)

题目描述一天,Chika 对大小接近的点对产生了兴趣,她想搞明白这个问题的树上版本,你能帮助她吗?Chika 会给 你一棵有根树,这棵树有 n 个结点,被编号为 1 n,1 号结点是根。每个点有一个权值,i 号结点的权值为 a[i]。如果 u 是 v 的祖先结点,并且 abs(a[u]−a[v]) ≤K,那么 (u,v) 被称作一个“** 大小接近的点对 **”。 对于树上的每个结点 i,你都...

2019-04-17 13:45:19 236

原创 Childhood dream (猜数字)

题目描述你童年时期就有一个梦想,想要加入 ACM(Association of Calculation and Magic),今天,这个机会终于 来了。但是 ACM 只想要哪些天赋异禀的人, 比如像 tourist,他们给了你一道题来检测你是否足够机智。猜一个长度为 m 数字串,总共有 n 个提示串,解释如下:8640 0A2BA 前面的数字说明与答案相比,有多少个位置...

2019-04-17 13:37:21 511

原创 最大下降矩阵(行的 最长上升子序列)

题目描述我们称一个矩阵是下降矩阵,当且仅当,矩阵的每一列都是严格下降的。很显然,这个要求很苛刻,大多数矩阵都无法满足。但是显然如果消去一些行,一定可以使得这个矩阵变成下降矩阵。现在给出一个n行m列的矩阵,请你求出最少消去多少行,可以使得这个矩阵变为下降矩阵。输入输入第一行包含两个正整数n,m分别表示矩阵的行数和列数。(1<=n,m<=300)接下来n行,每行有m个数,中...

2019-04-17 11:22:05 411

原创 Opening Ceremony (贪心)

For the grand opening of the algorithmic games in NlogNsglow, a row of tower blocks is set to be demolished in a grand demonstration of renewal. Originally the plan was to accomplish this with control...

2019-04-17 10:02:52 507

原创 Clock Pictures(KMP 给了两个指针个数一样时钟,旋转其中一个是否能得到另一个)

You have two pictures of an unusual kind of clock. The clock has n hands, each having the same length and no kind of marking whatsoever. Also, the numbers on the clock are so faded that you can’t e...

2019-04-17 09:45:03 506

原创 Catalan Square (卡特兰数 大数)

Last weekend you and your friends went to visit the local farmer’s market at the town square. As you were standing around in a circle talking, you couldn’t help overhearing two of your friends musing ...

2019-04-17 09:27:54 667

原创 点的距离 (倍增求LCA)

题目描述给定一棵 n个点的树,m 个询问,每次询问点 x到点 y两点之间的距离。输入格式第一行一个正整数,表示这棵树有 n 个节点;接下来 n - 1 行,每行两个整数 x,y 表示 x,y 之间有一条连边;然后一个整数 m,表示有 m 个询问;接下来 m 行每行两个整数 x,y 表示询问 x 到 y 的距离。输出格式输出 一行,每行表示每个询问的答案。样...

2019-04-16 18:51:46 591

原创 树状数组解决约瑟夫环

最后剩下的人int Josephus(int n, int k){ if (n<=0 || k<1) throw exception(); if (n==1) return 1;//人为规定,n为1时返回1 int res=k%2;//只有两个人时,返回的人的下标(从零开始计算) for (int i = 3; i <=n; i++) { res =...

2019-04-12 11:00:49 325

原创 Defending Plan Support (树的边 乘 权值 和最小)

题目描述The architectural structure of the college is strange, but the rule is that there is only one simple path between every two classrooms. Now the battle between Class A and Class F broke out. As a...

2019-04-12 10:00:05 385

原创 Dire Wolf (区间dp经典题)

Dire wolves, also known as Dark wolves, are extraordinarily large and powerful wolves. Many, if not all, Dire Wolves appear to originate from Draenor.Dire wolves look like normal wolves, but these ...

2019-04-11 09:17:58 1610

原创 Black And White (染色问题,剪枝)

In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous regions, producing a figure called a map, no more than four colors a...

2019-04-11 08:23:06 641 2

原创 Intersection (圆环相交的面积,两圆相交面积模板)

Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The following figures are some famous examples you may know.A ring is a 2-D figure bounded by two circles ...

2019-04-11 08:16:13 783

原创 A Simple Problem with Integers (线段树模板)

You haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the ...

2019-04-10 19:07:20 182

原创 组合数模板(卢卡斯 + 扩展卢卡斯)

求 C(n,m) %p的结果。当n太大时,我们无法打阶乘表,所以我们采用Lucas定理来求组合数。一 n , m ,mod 较大,mod为素数例题:mod<=1e9,n<=1e9, m<=1e4#include <iostream>#include <cstdio>#define LL long longusing names...

2019-04-09 19:49:30 224

原创 Wand (组合数 + 逆元 + 错排公式)

N wizards are attending a meeting. Everyone has his own magic wand. N magic wands was put in a line, numbered from 1 to n(Wand_i owned by wizard_i). After the meeting, n wizards will take a wand one b...

2019-04-09 17:47:48 803

vjudge_rank_python.7z

日常在vjudge上训练时,人工统计比赛信息太过于繁琐,由此修改了此爬虫。

2019-10-19

空空如也

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

TA关注的人

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