自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 传纸条

链接:https://ac.nowcoder.com/acm/contest/1116/L来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题。一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊...

2019-11-02 21:40:25 574

原创 不要打开

听说今天发博客送勋章,来打个卡各位程序员快乐啊

2019-10-24 20:27:11 268 1

原创 小小粉刷匠

题目链接题目描述"lalala,我是一个快乐的粉刷匠",小名一边快活地唱着歌,一边开心地刷着墙",兴致突然被打断,"小名,你今天如果刷不完这一栋楼的墙,那么你就等着被炒鱿鱼吧",老板声嘶力竭的吼着。苦恼的小名因为不想被炒鱿鱼,所以希望尽量快地刷完墙,由于他本人的数学基础很差,他现在请你来帮助他计算最少完成每一堵墙需要刷多少次。每一面墙有n个段,对于每个段指定一个目标颜色ci。刚开始的...

2019-10-16 09:20:12 274

原创 无题II

题目链接题目描述:这是一个简单的游戏,在一个n*n的矩阵中,找n个数使得这n个数都在不同的行和列里并且要求这n个数中的最大值和最小值的差值最小。输入:输入一个整数T表示T组数据。对于每组数据第一行输入一个正整数n(1<=n<=100)表示矩阵的大小。接着输入n行,每行n个数x(0<=x<=100)。输出:对于每组数据输出一个数表示最小差值。样...

2019-10-08 22:14:55 350

原创 Treasure Exploration

题目描述:Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored treasure? If you never have such experiences, you would nev...

2019-09-29 22:12:33 166

原创 Antenna Placement

题目描述:The Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery o...

2019-09-25 09:29:07 189

原创 Courses(hdu 1083)

题目描述:Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P students ...

2019-09-23 09:35:58 190

原创 1708: 01串也疯狂之光棍也有伴

题目描述:话说春节那天,小明和晓明在实验室刷题。刷着刷着小明觉得累了,就邀请晓明一起看春晚。晓明觉得小明很无聊,不想理小明,但是小明很会磨嘴皮子,晓明耐不住小明的胡嘴蛮缠,于是和小明一起看起春晚来。小明顿时觉得倍儿爽啊! 可是一看,“wocao”,“最炫小苹果”,小明顿时觉得很伤心。 “连小苹果都有伴了。。。呜呜。。。。” 晓明看到小明哭了,就想安慰他,可是怎么安慰呢!晓明陷入了沉思...

2019-09-20 17:12:55 157

原创 Counting Sequences I(2019 ICPC 上海站)

题目描述:We define a sequence a1,a2,…,an{a_1, a_2, …, a_n}a1​,a2​,…,an​ of positive integer numbers, as perfect sequence if it matches following qualities:n≥2n \ge 2n≥2, anda1+a2+…+an=a1×a2×…×ana_1 + a_2...

2019-09-18 21:26:35 515

原创 Stone game(2019 ICPC 上海站)

Stone game题目描述:CSL loves stone games. He has nnn stones; each has a weight aia_iai​. CSL wants to get some stones. The rule is that the pile he gets should have a higher or equal total weight than t...

2019-09-16 17:19:49 293

原创 B. Light bulbs(2019 ICPC上海站)

题目描述:There are NNN light bulbs indexed from 000 to N−1N-1N−1. Initially, all of them are off.A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L,R)FLIP(L, R)FLIP(L,R) means to...

2019-09-15 19:31:56 548 1

原创 L. Digit sum(2019 icpc上海站)

题目描述:A digit sum Sb(n)S_b(n)Sb​(n) is a sum of the base-bbb digits of nnn. Such as S10(233)=2+3+3=8S_{10}(233) = 2 + 3 + 3 = 8S10​(233)=2+3+3=8, S2(8)=1+0+0=1S_{2}(8)=1 + 0 + 0 = 1S2​(8)=1+0+0=1, S2(...

2019-09-15 19:19:42 261

原创 Drainage Ditches(最大流)

题目描述:Every time it rains on Farmer John’s fields, a pond forms over Bessie’s favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Th...

2019-09-07 21:14:51 171

原创 High bridge, low bridge

题目描述:最近下了很大的雨,小P都不能开心的出去玩耍了。所以无聊的小P找事来了。在这些天总共下了很多次雨,每次下雨后,河的水位都会上升一些,然后雨过后水位又会下降到一定位置。在这个河上有许多桥,小P想知道在这些雨过后,有多少桥被淹没不少于k次。如果桥的位置高于当前水位,洪水来后,水位上涨,将桥淹没(水位与桥同等高度也理解为桥被淹没),则计为该桥被淹没一次。第一次洪水来临前,水位为1。如果你...

2019-08-30 10:24:03 211

原创 Theme Section

题目描述:It’s time for music! A lot of popular musicians are invited to join us in the music festival. Each of them will play one of their representative songs. To make the programs more interesting and ...

2019-08-30 10:19:06 161

原创 Girls' research

题目描述:One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower c...

2019-08-30 10:14:19 183

原创 Palindrome

题目描述:Andy the smart computer science student was attending an algorithms class when the professor asked the students a simple question, “Can you propose an efficient algorithm to find the length of t...

2019-08-30 09:43:13 144

原创 How many

题目描述:Give you n ( n < 10000) necklaces ,the length of necklace will not large than 100,tell meHow many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two neckla...

2019-08-30 09:37:14 237

原创 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 ...

2019-08-30 09:31:20 135

原创 Substrings

题目描述:You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings....

2019-08-28 21:20:44 141

原创 Corporate Identity

题目描述:Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like trademarks. One of such companies is Internet Build...

2019-08-28 21:15:38 604

原创 Count the string

题目描述:It is well known that AekdyCoin is good at string problems as well as number theory problems. When given a string s, we can write down all the non-empty prefixes of this string. For example:s: ...

2019-08-28 21:10:22 207

原创 Simpsons’ Hidden Talents

题目描述:Homer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have a talent in poli...

2019-08-28 21:04:00 144

原创 Blue Jeans

题目描述:The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth was popula...

2019-08-28 20:59:49 197

原创 Seek the Name, Seek the Fame

题目描述:The little cat is so famous, that many couples tramp over hill and dale to Byteland, and asked the little cat to give names to their newly-born babies. They seek the name, and at the same time s...

2019-08-28 20:53:08 116

原创 Power Strings

题目描述:Given two strings a and b we define ab to be their concatenation. For example, if a = “abc” and b = “def” then ab = “abcdef”. If we think of concatenation as multiplication, exponentiation by a ...

2019-08-28 20:48:14 100

原创 Period

题目描述:For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each...

2019-08-28 20:43:28 158

原创 Cyclic Nacklace

题目描述:CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and thinking about ...

2019-08-28 20:35:42 129

原创 剪花布条

题目描述:一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?输入:输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字符有多少个,布条的花纹也有多少种花样。花纹条和小饰条不会超过1000个字符长。如果遇见#字符,则不再进行工作。输出:输出能从...

2019-08-28 20:30:18 134

原创 Oulipo

题目描述:The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He was a member of the Oulipo group. A quote from the book:Tout avait Pair normal, mais to...

2019-08-28 20:20:46 176

原创 Number Sequence

题目描述:Given two sequences of numbers : a[1], a[2], … , a[N], and b[1], b[2], … , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1]...

2019-08-28 20:12:56 1011

原创 SPF

题目描述:Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis, a failure of a single node, 3, in the network...

2019-08-25 21:00:26 474

原创 Network

题目描述:A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N . No two places have the same number. The lines ...

2019-08-25 20:48:48 261

原创 Summer Holiday

题目描述:To see a World in a Grain of SandAnd a Heaven in a Wild Flower,Hold Infinity in the palm of your handAnd Eternity in an hour. —— William Blake 听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的夜不能...

2019-08-25 20:38:06 219

原创 Popular Cows

题目描述:DescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the for...

2019-08-25 20:10:26 564

原创 迷宫城堡

题目描述:为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到达A房间。Gardon需要请你写个程序确认一下是否任意两个房间都是相互连通的,即:对于任意的i和j,至少存在一条路径可以从房间...

2019-08-25 19:59:39 267

原创 Hawk-and-Chicken详解

题目描述:Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk.So the teacher came up with an ide...

2019-08-24 15:35:49 738

转载 Tarjan算法详细讲解

Tarjan算法讲解的博客网上找到三篇比较好的,现在都转载了,个人只研究了第一篇,正如博主所说,讲的标比较详细,清晰,剩下两篇也可以看一下.卿学姐视频讲解 https://www.bilibili.com/video/av7330663/以下内容转自:http://www.cnblogs.com/uncle-lu/p/5876729.html全网最详细tarjan算法讲解,我不敢说别的。反正...

2019-08-23 09:15:55 13041 3

转载 树状数组详解

来看几个问题吧。1.什么是树状数组?顾名思义,就是用数组来模拟树形结构呗。那么衍生出一个问题,为什么不直接建树?答案是没必要,因为树状数组能处理的问题就没必要建树。和Trie树的构造方式有类似之处。2.树状数组可以解决什么问题可以解决大部分基于区间上的更新以及求和问题。3.树状数组和线段树的区别在哪里树状数组可以解决的问题都可以用线段树解决,这两者的区别在哪里呢?树状数组的系数要少很多...

2019-08-22 11:19:55 195

原创 Looooops

dfasf

2019-08-22 11:08:27 119

空空如也

空空如也

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

TA关注的人

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