自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

tomjobs的博客

I was so much older then, I'm younger than that now.

  • 博客(71)
  • 收藏
  • 关注

原创 洛谷P2424 约数和(除法分块)

展开题目背景Smart最近沉迷于对约数的研究中。题目描述对于一个数X,函数f(X)表示X所有约数的和。例如:f(6)=1+2+3+6=12。对于一个X,Smart可以很快的算出f(X)。现在的问题是,给定两个正整数X,Y(X<Y),Smart希望尽快地算出f(X)+f(X+1)+……+f(Y)的值,你能帮助Smart算出这个值吗?输入格式输入文件仅一行,两个正整数X和Y(X&lt...

2020-01-31 20:06:21 347

原创 Economic Difficulties CodeForces - 1263F(DP)

An electrical grid in Berland palaces consists of 2 grids: main and reserve. Wires in palaces are made of expensive material, so selling some of them would be a good idea!Each grid (main and reserve...

2020-01-31 16:25:55 359

原创 Editor CodeForces - 1263E(线段树)

The development of a text editor is a hard problem. You need to implement an extra module for brackets coloring in text.Your editor consists of a line with infinite length and cursor, which points to...

2020-01-31 16:12:04 346

原创 Secret Passwords CodeForces - 1263D(并查集)

One unknown hacker wants to get the admin’s password of AtForces testing system, to get problems from the next contest. To achieve that, he sneaked into the administrator’s office and stole a piece of...

2020-01-31 15:56:16 292

原创 Everyone is a Winner! CodeForces - 1263C(二分 除法分块)

On the well-known testing system MathForces, a draw of n rating units is arranged. The rating will be distributed according to the following algorithm: if k participants take part in this event, then ...

2020-01-31 15:52:57 355

原创 PIN Codes CodeForces - 1263B

A PIN code is a string that consists of exactly 4 digits. Examples of possible PIN codes: 7013, 0000 and 0990. Please note that the PIN code can begin with any digit, even with 0.Polycarp has n (2≤n≤...

2020-01-31 15:47:46 257

原创 Sweet Problem CodeForces - 1263A

You have three piles of candies: red, green and blue candies:the first pile contains only red candies and there are r candies in it,the second pile contains only green candies and there are g candie...

2020-01-31 15:44:50 282

原创 高精度算法之加 减 乘 除 阶乘和

如果是寻找高精度(大整数)类,请转移到https://blog.csdn.net/tomjobs/article/details/99988413 或https://blog.csdn.net/tomjobs/article/details/101856803这里只是简单的数组模拟,巩固一下基础。高精度加法:直接一位一位的加就好了,大于10就进到下一位#include <cstdi...

2020-01-30 17:14:11 330

原创 BZOJ1010: [HNOI2008]玩具装箱toy(斜率优化dp)

Description  P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京。他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中。P教授有编号为1…N的N件玩具,第i件玩具经过压缩后变成一维长度为Ci.为了方便整理,P教授要求在一个一维容器中的玩具编号是连续的。同时如果一个一维容器中有多个玩具,那么两件玩具之间要加入一个单位长度的填充物,形...

2020-01-30 11:11:19 245

原创 Minimum Inversion Number HDU - 1394(逆序数变形)

The inversion number of a given number sequence a1, a2, …, an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For a given sequence of numbers a1, a2, …, an, if we move the first ...

2020-01-29 12:52:29 3471

原创 POJ 2991 Crane(计算几何+线段树)

DescriptionACM has bought a new crane (crane – jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning of th...

2020-01-28 20:42:50 299

原创 Extend KMP HihoCoder - 1084(二分+hash)

Do you know KMP? It is used to judge whether a string is a substring of another string. Today we want to extend it.In information theory, the Hamming distance between two strings of equal length is t...

2020-01-28 16:51:37 321

原创 P1461 海明码 Hamming Codes

题目描述给出 n,b,dn,b,d,要求找出 nn 个由 0,10,1 组成的编码,每个编码有 bb 位),使得两两编码之间至少有 dd 个单位的 “Hamming距离”。“Hamming距离”是指对于两个编码,他们二进制表示法中的不同二进制位的数目。看下面的两个编码 0x554 和 0x234(十六进制数)0x554 = 0101 0101 01000x234 = 0010 0011 0...

2020-01-28 13:01:53 368

原创 Ping pong UVA - 1428(树状数组)

N (3 ≤ N ≤ 20000) ping pong players live along a west-east street(consider the street as a line segment).Each player has a unique skill rank. To improve their skill rank, they often compete with each...

2020-01-28 00:28:03 221

原创 BZOJ3098. Hash Killer II(生日攻击)

Description这天天气不错,hzhwcmhf神犇给VFleaKing出了一道题:给你一个长度为N的字符串S,求有多少个不同的长度为L的子串。子串的定义是S[l]、S[l + 1]、… S[r]这样连续的一段。两个字符串被认为是不同的当且仅当某个位置上的字符不同。VFleaKing一看觉得这不是Hash的裸题么!于是果断写了哈希 + 排序。而hzhwcmhf神犇心里自然知道,这题...

2020-01-27 22:03:21 340

转载 《你和你的研究》全文

学习海明码的时候看到的。海明码表示将一个字符串转化为另一个字符串的最小修改次数。相关题目:HihoCoder1084(hash + 二分)洛谷P1461海明码HammingCodesYou and Your Research这是大科学家 Richard Hamming 的著名讲演,于 1986 年在贝尔通讯研究中心给 200 多名 Bellcore 的科学家们所做。演讲者介绍: Ric...

2020-01-27 20:47:14 7596

转载 编程巨星的唯一秘诀

导读:本文是从《The Singular Secret of the Rockstar Programmer》这篇文章翻译而来。译文来自外刊IT评论《编程巨星的唯一秘诀》。别以为是那些软件开发定律,别以为是开发出那些特殊用途的软件,别以为是软件设计技术本身。只有一条真理决定了一个软件程序员的成功还是失败。由于坚持这个真理,一个资深的程序员能在一天的时间里学会一门新的编程语言,而由于不坚持这条真理...

2020-01-27 20:03:06 229

原创 BZOJ3689. 异或之(01字典树第k小)

Description给定n个非负整数A[1], A[2], ……, A[n]。对于每对(i, j)满足1 <= i < j <= n,得到一个新的数A[i] xor A[j],这样共有n*(n-1)/2个新的数。求这些数(不包含A[i])中前k小的数。注:xor对应于pascal中的“xor”,C++中的“^”。Input第一行2个正整数 n,k,如题所述。以下n行...

2020-01-27 14:54:31 569

原创 Hotaru's problem HDU - 5371(manacher)

Hotaru Ichijou recently is addicated to math problems. Now she is playing with N-sequence.Let’s define N-sequence, which is composed with three parts and satisfied with the following condition:the ...

2020-01-26 20:51:55 322

原创 Counting Sequences HDU - 3450(多元上升组 树状数组)

For a set of sequences of integers{a1,a2,a3,…an}, we define a sequence{ai1,ai2,ai3…aik}in which 1<=i1<i2<i3<…<ik<=n, as the sub-sequence of {a1,a2,a3,…an}. It is quite obvious that a...

2020-01-26 17:06:44 367

原创 51nod1089 最长回文子串 V2(Manacher算法/哈希)

回文串是指aba、abba、cccbccc、aaaa这种左右对称的字符串。输入一个字符串Str,输出Str里最长回文子串的长度。输入输入Str(Str的长度 <= 100000)输出输出最长回文子串的长度L。输入样例daabaac输出样例5知乎上 https://www.zhihu.com/question/37289584 ”c加加编程思想“ 答主的回答很棒。思路:...

2020-01-25 23:37:43 362

原创 BZOJ3942: [Usaco2015 Feb]Censoring(KMP)

DescriptionFarmer John has purchased a subscription to Good Hooveskeeping magazine for his cows, so they have plenty of material to read while waiting around in the barn during milking sessions. Unfo...

2020-01-25 18:03:24 372

原创 Japan POJ - 3067(逆序对)

Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= 500000, N ...

2020-01-24 23:32:50 562

原创 Crazy Thairs POJ - 3378(10000进制加法 树状数组)

These days, Sempr is crazed on one problem named Crazy Thair. Given N (1 ≤ N ≤ 50000) numbers, which are no more than 109, Crazy Thair is a group of 5 numbers {i, j, k, l, m} satisfying:1 ≤ i < ...

2020-01-24 16:06:57 4518

原创 LCIS HDU - 3308(线段树区间合并)

Given n integers.You have two operations:U A B: replace the Ath number by B. (index counting from 0)Q A B: output the length of the longest consecutive increasing subsequence (LCIS) in [a, b].Inpu...

2020-01-23 21:49:32 268

原创 Buy Tickets POJ - 2828(线段树离线)

Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little Cat still had sche...

2020-01-23 20:43:34 380

原创 Count Color POJ - 2777(线段树cover标记)

Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem.There is a very long board with length L centimeter, L is ...

2020-01-23 17:55:44 221

原创 Horizontally Visible Segments POJ - 1436(线段树区间覆盖)

There is a number of disjoint vertical line segments in the plane. We say that two segments are horizontally visible if they can be connected by a horizontal line segment that does not have any common...

2020-01-23 16:25:27 289

原创 Help with Intervals POJ - 3225(线段树区间异或)

LogLoader, Inc. is a company specialized in providing products for analyzing logs. While Ikki is working on graduation design, he is also engaged in an internship at LogLoader. Among his tasks, one is...

2020-01-23 00:34:40 333

原创 "Ray, Pass me the dishes!" UVA - 1400(线段树区间合并)

After doing Ray a great favor to collect sticks for Ray, Poor Neal becomes very hungry. In returnfor Neal’s help, Ray makes a great dinner for Neal. When it is time for dinner, Ray arranges all thed...

2020-01-22 17:42:28 324

原创 Mayor's posters POJ - 2528(离散化 线段树)

The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally d...

2020-01-21 22:28:18 207

原创 Memory Control HDU - 2871(线段树区间合并)

Memory units are numbered from 1 up to N.A sequence of memory units is called a memory block.The memory control system we consider now has four kinds of operations:Reset Reset all memory units fre...

2020-01-21 21:13:42 211

原创 Who Gets the Most Candies? POJ - 2886(线段树)

N children are sitting in a circle to play a game.The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero integer on it in his/her hand. The game starts from...

2020-01-21 15:22:31 379

原创 ACWING310. 启示录(数位dp+二分)

古代人认为666是属于魔鬼的数。不但如此,只要某数字的十进制表示中有三个连续的6,古代人也认为这是个魔鬼的数,比如666,1666,6663,16666,6660666等等。古代典籍中经常用“第X小的魔鬼的数”来指代这些数,这给研究人员带来了极大的不便。现在请编写一个程序,可以实现输入X,输出对应的魔鬼数。输入格式第一行包含整数T,表示共有T组测试数据。每组测试数据占一行,包含一个整数...

2020-01-21 01:01:45 345

原创 ACWING311. 月之谜(数位DP)

如果一个十进制数能够被它的各位数字之和整除,则称这个数为“月之数”。给定整数L和R,你需要计算闭区间[L,R]中有多少个“月之数”。输入格式输入占一行,包含两个整数L和R。输出格式输出一个整数,表示月之数的个数。数据范围1≤L,R<231输入样例:1 100输出样例:33思路:如果记录的是数字大小和数字位总和,最后再来比较,那么就不能实现记忆化(相当于每个数字都判断...

2020-01-21 00:28:29 523 1

原创 XHXJ's LIS HDU - 4352(LIS,数位dp)

#define xhxj (Xin Hang senior sister(学姐))If you do not know xhxj, then carefully reading the entire description is very important.As the strongest fighting force in UESTC, xhxj grew up in Jintang, a...

2020-01-20 23:56:05 238

原创 B-number HDU - 3652(数位dp)

A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string “13” and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ar...

2020-01-20 19:23:18 237

原创 Barbara Bennett's Wild Numbers POJ - 3340(贪心)

A wild number is a string containing digits and question marks (like 36?1?8). A number X matches a wild number W if they have the same length, and every non-question mark character in X is equal to th...

2020-01-20 18:18:56 277

原创 CF1293A. ConneR and the A.R.C. Markland-N

A.R.C. Markland-N is a tall building with ???? floors numbered from 1 to ????. Between each two adjacent floors in the building, there is a staircase connecting them.It’s lunchtime for our sensei Colin “Co...

2020-01-20 11:55:26 548

原创 CF1293B. JOE is on TV!

3R2 - Standby for ActionOur dear Cafe’s owner, JOE Miller, will soon take part in a new game TV-show “1 vs. ????”!The game goes in rounds, where in each round the host asks JOE and his opponents a comm...

2020-01-20 11:53:58 321

空空如也

空空如也

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

TA关注的人

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