自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

因为一无所有,所以拥有无限可能。

Blazblue|音游|ACM|游戏王|炉石|慵懒的凡人

  • 博客(40)

原创 Sqrt Approaching (数学推导+放缩)

原题题面Given three positive integers A,B,nA,B,nA,B,n, where nnn is NOT a perfect square number, you should find two positive integers C,DC,DC,D satisfying (BC−AD)(C−Dn)<0(BC - AD)(C - D\sqrt{n}) < 0(BC−AD)(C−Dn​)<0输入格式The first line contains one i

2020-10-25 19:12:09 133 1

原创 HDU 6704 K-th occurrence 2019CCPC网络赛 (后缀数组+ST表+二分+主席树)

题面描述You are given a string S consisting of only lowercase english letters and some queries.For each query (l,r,k)(l,r,k)(l,r,k), please output the starting position of the k−thk-thk−th occurence of the substring SlSl+1...SrS_lS_{l+1}...S_rSl​Sl+1​...Sr​

2020-10-22 16:57:15 32

原创 POJ - 3693 Maximum repetition substring (后缀数组+ST表)

原题题面The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of “ababab” is 3 and “ababa” is 1.Given a string containing lowercase

2020-10-20 21:19:05 24

原创 POJ 1743 Musical Theme(后缀数组+二分)

原题题面A musical melody is represented as a sequence of N(1≤N≤20000)N(1\leq N\leq 20000)N(1≤N≤20000)notes that are integers in the range 1…88, each representing a key on the piano. It is unfortunate but true that this representation of melodies ignores the n

2020-10-18 14:27:22 10

原创 URAL-1996 (KMP+FFT)

原题题面Leia: I have placed information vital to the survival of the rebellion into the memory systems of this R2 unit. My father will know how to retrieve it. You must see this droid safely delivered to him on Alderaan.Emperor Palpatine has been ruling the

2020-10-09 12:05:18 24

原创 HDU 4609 3-idiots(FFT)

原题题面King OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of performance art, and begged the king to free them. Out of hatred to the real idiots, the king wanted to check if

2020-10-08 21:17:34 49

原创 P3763 [TJOI2017]DNA (FFT)

原题题面加里敦大学的生物研究所,发现了决定人喜不喜欢吃藕的基因序列 SSS,有这个序列的碱基序列就会表现出喜欢吃藕的性状,但是研究人员发现对碱基序列 SSS,任意修改其中不超过 3 个碱基,依然能够表现出吃藕的性状。现在研究人员想知道这个基因在 DNA 链 S0S_0S0​上的位置。所以你需要统计在一个表现出吃藕性状的人的 DNA 序列 S0S_0S0​上,有多少个连续子串可能是该基因,即有多少个S0S_0S0​的连续子串修改小于等于三个字母能够变成 SSS。输入格式第一行有一个整数TTT,表示有几组

2020-10-05 14:13:28 17

原创 P4157 [SCOI2006]整数划分 (数学推导+大数)

原题题面读入一个正整数nnn(10≤n≤3100010≤n≤3100010≤n≤31000)。要求将nnn写成若干个正整数之和,并且使这些正整数的乘积最大。例如,n=13n=13n=13,则当n表示为4+3+3+34+3+3+34+3+3+3(或2+2+3+3+32+2+3+3+32+2+3+3+3)时,乘积=108108108为最大。输入格式只有一个正整nnn(10≤n≤3100010≤n≤3100010≤n≤31000)输出格式第1行输出一个整数,为最大乘积的位数。第2行输出最大乘积的前1

2020-10-04 16:23:06 32 1

原创 HDU 1079 Calendar Game(博弈论SG函数)

原题题面Adam and Eve enter this year’s ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this contest. This game consists of the dates from January 1, 1900 to November 4, 2001, the contest day. The

2020-09-21 16:35:08 7

原创 P3384 树链剖分(树链剖分)

原题题面已知一棵包含 NNN 个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作:操作 111: 格式:1 x y z1\ x\ y\ z1 x y z 表示将树从 xxx 到 yyy 结点最短路径上所有节点的值都加上 zzz。操作 222: 格式: 2 x y2\ x\ y2 x y 表示求树从 xxx 到 yyy 结点最短路径上所有节点的值之和。操作 333: 格式: 3&nbsp

2020-09-01 14:37:20 27

原创 HDU 6869 Slime and Stones (威佐夫博弈扩展)

原题题面Orac and Slime are playing a game.There are two groups of stones, the first group contains a stones and the second contains b stones. Orac and Slime operate them by turns in the game. For each operation, they have two choices:Pick up any number of

2020-08-18 17:52:52 341 1

原创 SPOJ-COT Count on a tree (LCA+可持久化线段树)

这里写自定义目录标题原题题面输入格式输出格式输入样例输出样例题面分析原题题面You are given a tree with NNN nodes. The tree nodes are numbered from 1 to NNN. Each node has an integer weight.We will ask you to perform the following operation:u v ku\ v\ ku v k : ask for the

2020-08-18 09:57:29 56 1

原创 Groundhog Chasing Death 2020牛客多校第九场(质因子分解+欧拉降幂)

原题题面As we all know,“Groundhog chasing death” means “GCD”,while “GCD” stands for “greatest common divisor”.So you need to calculate ∏i=ab∏j=cdgcd⁡(xi,yj)\prod_{i=a}^b\prod_{j=c}^d\gcd(x^i,y^j)∏i=ab​∏j=cd​gcd(xi,yj) modulo 998244353998244353998244353输入格式

2020-08-09 15:22:18 81

原创 HDU 6833 A Very Easy Math Problem(莫比乌斯反演)

原题题面Given you n,x,k , find the value of the following formula:∑a1=1n∑a2=1n...∑ax=1n(∏j=1xajk)f(gcd(a1,a2,...ax))∗gcd(a1,a2,...ax)\sum_{a_1=1}^{n}\sum_{a_2=1}^{n}...\sum_{a_x=1}^{n}(\prod_{j=1}^{x}a_{j}^{k})f(gcd(a_1,a_2,...a_x))*gcd(a_1,a_2,...a_x)∑a1​=1

2020-08-07 17:17:30 106

原创 HDU 6588 Function 2019杭电多校第一场(莫比乌斯反演)

原题题面Jerry is fond of functions. He thinks the mystery of the universe is hidden behind the notations, variables and numbers.Of all functions, he thinks gcd and ⌊x⌋⌊x⌋⌊x⌋ are the most fascinating, and that something combines gcd with truncation should be

2020-08-07 15:13:46 81

原创 HDU 6825 Set1 2020杭电多校(数学推导)

原题题面You are given a set S=1..nS={1..n}S=1..n. It guarantees that nnn is odd. You have to do the following operations until there is only 111 element in the set:Firstly, delete the smallest element of SSS. Then randomly delete another element from SSS.Fo

2020-08-04 22:24:49 117

原创 HDU 6822 Paperfolding 2020杭电多校第五场(数学推导)

原题题面There is a piece of paper in rectangular shape with sufficient length and width (lay flat on the table). Execute an operation instruction according to a string of length n from left to right that only contains 4 different characters of L,R,U,DL,R,U,DL

2020-08-04 20:13:28 191

原创 HDU 6814 Tetrahedron 2020杭电多校第五场 (数学推导)

原题题面Generate three integers a, b, and c in [1,n][1,n][1,n] with equal probability independently, and use them as the three right-angle side length of a right-angled tetrahedron. Find the expectation of the reciprocal square of the distance from the right-

2020-08-04 19:23:26 292

原创 Game SET 2020牛客多校第八场(模拟)

原题题面SETSETSET is a real-time card game designed by Marsha Falco in 1974 and published by Set Enterprises in 1991. The deck consists of 81 unique cards that vary in four features across three possibilities for each kind of feature: number of shapes (one, t

2020-08-03 18:26:56 168

原创 HDU 6755 Fibonacci Sum (二项式定理+预处理) 2020杭电多校第一场

原题题面The Fibonacci numbers are defined as below:F0=0,F1=1F_0=0,F_1=1F0​=0,F1​=1Fn=Fn−2+Fn−1(n>1)F_n=F_{n-2}+F_{n-1}(n>1)Fn​=Fn−2​+Fn−1​(n>1)Given three integers NNN, CCC and KKK, calculate the following summation:(F0)K+(FC)K+(F2C)K+(F3C)K...+(

2020-07-22 13:29:46 1174 3

原创 Harder Gcd Problem 2020牛客多校第四场(质数筛+构造)

原题题面给出一正整数nnn,找到{1,2,3,...,n}\{1,2,3,...,n\}{1,2,3,...,n}的两个子集合A,BA,BA,B,使:(1)∣A∣=∣B∣=m,A∩B=∅|A|=|B|=m,A∩B=∅∣A∣=∣B∣=m,A∩B=∅(2)令A={a1,a2...am},B={b1,b2,...bm}A=\{a_1,a_2...a_m\},B=\{b_1,b_2,...b_m\}A={a1​,a2​...am​},B={b1​,b2​,...bm​},存在两种排列方式{p1,p2,...p

2020-07-20 22:23:00 106

原创 Fraction Construction Problem 2020牛客多校第三场(扩展欧几里得)

原题题面有T个输入。每组输入给出两个正整数a,b(a,b≤2×106)a,b(a,b\leq 2 × 10^6)a,b(a,b≤2×106)。请找到四个正整数c,d,e,f(f<b,d<b,1≤c,e≤4×1012)c,d,e,f(f<b,d<b,1\leq c,e \leq 4× 10^{12})c,d,e,f(f<b,d<b,1≤c,e≤4×1012),使他们满足:cd−ef=ab\frac{c}{d}-\frac{e}{f}=\frac{a}{b}dc​−f

2020-07-18 19:54:58 951 1

原创 Keyboard Free (计算几何+自适应辛普森积分/等分圆)2020牛客多校第二场

原题题面Given three concentric circles whose radiuses are r1r_1r1​,r2r_2r2​,r3r_3r3​respectively, and A,B,CA,B,CA,B,C are the moving points on the given three circles respectively. Determine the expected area of △ABC\triangle ABC△ABC .输入描述The first line con

2020-07-14 22:01:32 1102 2

原创 Boundary 2020牛客多校第二场 (计算几何)

原题题面Given nnn points in 2D plane. Considering all circles that the origin point (0,0)(0,0)(0,0) is on their boundries, find the one with the maximum given points on its boundry. Print the maximum number of points.输入描述The first line contains one integer

2020-07-13 22:22:50 279 4

原创 Easy Integration(Wallis积分)(2020牛客多校第一场J题)

原题题面时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288KGiven n, find the value of ∫01(x−x2)n dx\int_0^1 {(x-x^2)^n} \,{\rm d}x∫01​(x−x2)ndx.It can be proved that the value is a rational number pq\frac{p}{q}qp​.Print the result as p⋅q−1 mod 9

2020-07-12 19:04:44 791

原创 (个人复习用)jsp web开发重点(待补充)

文章目录一、 JSP简介Tomcat 相关JSP原理二、JSP语法JSP页面组成JSP注释JSP标记pagecontentType(响应类型、字符编码)language(JSP使用的脚本语言)import(声明包、类)session(是否需要session,默认是true)buffer(out的缓冲区大小,默认8kb,也可以设置为none,即不使用)autoflush(out缓冲区被填满时是否自动刷新,默认为true)isThreadSafe(是否可多线程访问,默认为true)info(为jsp准备一个常用

2020-06-14 15:26:26 235

原创 洛谷 P6583 回首过去 (数论+容斥定理)

写在前面笔者是一名十八线蒟蒻ACMer,文中可能会有多处错误与疏漏,欢迎指出。原题题面洛谷 P6583 回首过去给定正整数 nnn,求出有序整数对 (x,y)(x,y)(x,y) 的个数,满足:1≤x,y≤n,1≤x,y≤n1\leq x,y\leq n,1≤x,y≤n1≤x,y≤n,1≤x,y≤n 且xy\frac{x}{y}yx​ 可以表示为十进制有限小数。对于40%的数据,1≤n≤1031\leq n\leq 10^31≤n≤103,对于40%的数据,1≤n≤1071\leq n\leq

2020-06-02 18:58:23 203

原创 Codeforces Round #641 (Div. 2) C. Orac and LCM(质因子分解)

写在前面笔者是一名十八线蒟蒻ACMer,文中可能会有多处错误与疏漏,欢迎指出。原题体面原题地址时间:3 seconds空间:256MFor the multiset of positive integers s=s1,s2,…,sks={s_1,s_2,…,s_k}s=s1​,s2​,…,sk​, define the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of s as follow:gcd(s)gcd(s

2020-05-13 22:43:29 106

原创 (个人复习用)软件测试与质量重点(待补充)

一、概述1.1软件测试(以需求为中心,通过设计测试用例,保证系统满足需求)阶段执行方法人工动态测试人工静态测试自动动态测试方法评价标准具体流程1.2软件缺陷(功能超过需求规格说明中指出的范围,即用户不满意)常见情况1.3测试用例(时间、成本、质量)输入数据操作步骤1.4软件质量(反映软件具有明确或隐含需要能力的特性总和,可以通过软件测试验证,但不能通过它提高)二、黑盒测试(只知道输入和预期输出、...

2020-05-05 17:51:55 1298 1

原创 (个人复习用)软件建模与设计(待补充)

这里写目录标题复杂系统控制软件复杂性的基本方法分解(把大问题化解成小问题)抽象(抽取基本特性,忽略其他)模块化(**高内聚、低耦合**)信息隐蔽(**封装**,只需要知道模块功能而不需要了解内部细节)面向对象特性开发模式UML视图分类(4+1)类模型(描述内部对象及其关系)对象(拥有唯一标识)类(拥有相同属性、行为、关系的一组对象)类图值和属性属性可见性操作&方法链接(对象之间的连接,关联...

2020-05-05 17:51:27 902

原创 ACM数列相关

写在前面按理来说,求数列通项本应该属于数学范围,但ACM中也有数列推导题的出现,处于方便,笔者决定把一些常见数列整理出来。注:笔者是一名十八线蒟蒻,如果有错误请在评论区下留言,谢谢您帮助我做得更好。前置知识无!带上你的小脑瓜跟着学就是了!一、基础数列(等比、等差、等比*等差,累加,累乘)众所周知,(1)对于an=an−1+d(n≥2)a_n=a_{n-1}+d(n\geq2)an​=...

2020-02-05 23:21:35 165

原创 HDU 6632 discrete logarithm problem (Pohlig-hellman算法)

原题题面给定三个数 p,a,b(p∈prime,65537≤p≤1018,2≤a,b≤p−1)p,a,b(p∈prime,65537≤p≤10^{18}, 2≤a,b≤p−1)p,a,b(p∈prime,65537≤p≤1018,2≤a,b≤p−1), p−1p−1p−1 的质因子只有 222 和/或 333. 请算出最小的 xxx 使得ax≡b(mod p)a^x\equiv b(...

2020-01-23 20:43:26 140

原创 离散对数问题——pohlig-hellman算法讲解(有例子)

写在前面一切都要从去年8月的多校开始说起。笔者在多校某场比赛中,遇到一个离散对数的题:HDU 6632给定a,b,p(p∈prime,65537≤p≤1e18,2≤a,b≤p−1且p−1的质因子只能由2(和/或)3组成)a,b,p(p∈prime,65537\leq p \leq 1e18,2\leq a,b\leq p-1且p-1的质因子只能由2(和/或)3组成)a,b,p(p∈prime...

2020-01-22 13:22:45 1905 7

原创 2019 ACM-CCPC厦门站赛后感

笔者今年第一次参加CCPC这样的赛事,结果自然是一言难尽…开局的时候开了A题,队友A没搞懂最优策略,卡了半小时。看榜之后发现大家都在写G,然后队友B用进制转化的方法去搞,RE了十几发。于是全队心态爆炸,接下来半小时无人开题。差不多两个小时之后,队友A过了A题,然后队友B开了I题,但情况少算了几种一直WA。我和队友A讨论J的思路,尽管赛后证明我的贪心思路是对的,但还是没人敢开J。最后半小...

2019-10-22 16:34:51 289 3

原创 牛客练习赛53 B 美味果冻(数学推导+快速幂优化)

写在前面需要学会的前置技能:快速幂逆元一定的数学推导能力原题题面求∑i=1n∑j=1ii⌊\sum_{i=1}^{n}\sum_{j=1}^{i}i\lfloor∑i=1n​∑j=1i​i⌊ij\frac{i}{j}ji​⌋j mod (1e9+7)\rfloor^{j}\ mod\ (1e9+7)⌋j mod (1e9+7)的结果。(n≤3e6...

2019-10-12 09:18:56 251

原创 Codeforces Round #589 (Div. 2) C.Primes and Multiplication (数学推导+容斥原理+快速幂)

写在前面需要学会的前置技能:快速幂一颗热爱学习的心原题体面时间限制t:1 second空间限制:256 MBLet’s introduce some definitions that will be needed later.Let prime(x)prime(x)prime(x) be the set of prime divisors of xxx. For example, ...

2019-09-30 11:07:24 138

原创 2019 南昌ICPC网络赛 H题 The Nth Item (二阶线性数列递推+快速幂优化) or (矩阵快速幂+广义斐波那契循环节)

原题题面For a series FFF:F(0)=0,F(1)=1F(0) = 0,F(1) = 1F(0)=0,F(1)=1F(n)=3∗F(n−1)+2∗F(n−2),(n≥2)F(n) = 3*F(n-1)+2*F(n-2),(n \geq 2)F(n)=3∗F(n−1)+2∗F(n−2),(n≥2)We have some queries. For each query NNN,...

2019-09-08 23:58:27 582 3

原创 2019 南京ICPC网络赛 B super_log(幂塔函数求模、扩展欧拉降幂)

注:笔者是一名十八线蒟蒻 ACMerACMerACMer,因此文中可能有许多 BUGBUGBUG ,请大佬们在评论区下留言,我会尽快改进。原题In Complexity theory, some functions are nearly O(1)O(1)O(1), but it is greater then O(1)O(1)O(1). For example, the complexity ...

2019-09-02 15:16:33 461 7

原创 HDU 6467 简单数学题 广东工业大学第十四届程序设计竞赛 (数学推导+快速幂)

原题题面已知求F(n)F(n)F(n) modmodmod 1e9+71e9+71e9+7题面分析乍一看,是个很难的题。仔细一看,其实是个水题(手动滑稽保命)。众所周知我们可以发现ΣΣΣ是通过构造F(n−1)F(n-1)F(n−1)来消去的。于是↓↓↓两式相减得↓↓↓看到这里有些聪明的读者就可能看出来了。这是一个经典结论, 下面给出证明。我们都知道因此我们构造一个...

2019-08-21 11:06:34 95

原创 HDU 6680 Rikka with Quicksort(2019杭电多校第9场1001) 数学推导+分块

HDU 6680 Rikka with Quicksort(2019杭电多校第9场1001) 数学推导+分块原题题面题面分析分块这是笔者的第一篇博客。为了能让更多的人看懂。所以本文的叙述的节奏相对很缓慢,有基础的同学可以选择性地跳读。作为一个十八线的蒟蒻ACMer,文中可能出现各种BUG和表达歧义的情况,同时,笔者对Markdown的编辑器使用并不是特别熟练,望各位能给我提出意见,帮助我做得更...

2019-08-21 08:56:01 784 7

空空如也

空空如也

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