自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 C/C++二维数组传参

C/C++二维数组传参

2022-06-05 21:58:28 1031

原创 CF Round599 Div.2

B1. Character Swap (Easy Version)B2. Character Swap (Hard Version)题意:给你两个长度为n的字符串s,t,字符串只包含26个小写字母。你的操作是每次从两个字符串中分别挑一个字母出来交换,问能不能使得两个串相等。第一问中你只能操作1次(且必须操作1次),n≤10000n\leq 10000n≤10000第二问中你最多可以操作 ...

2019-11-12 15:24:11 154

原创 CF Round598 Div.3

A. Payment Without Change题意:你有a个面值为n的硬币和b个一元硬币,问能不能整好凑出S分析:尽可能的用n,剩下的用1去补B. Minimize the Permutation题意:给你1-n的置换,n≤100n\leq 100n≤100,每个位置i只允许与i+1发生一次交换。问若干次交换后能得到的字典序最小的置换。分析:贪心。先把1移到最前面,假设1最初在下标x...

2019-11-07 12:17:40 180

原创 CF Round597 Div.2

C. Constanze’s Machine题意:有一个键盘,你敲w的时候就弹出uu,你敲m的时候就弹出nn,其他正常。现在给你一个用该键盘敲出的字符串,问你原字符串有多少种可能。思路:首先字符串中不可能出现w和m。对于连续的u和n,用dp求出这一段可能对应的原字符串个数。然后乘起来就好了。D. Shichikuji and Power Grid题意:有n个城市,n≤200n\leq 20...

2019-11-07 11:31:09 174

原创 cf 739B Alyona and a tree

一 原题http://codeforces.com/contest/739/problem/B二 分析题意:给你一棵树,每个顶点和每条边都有一个权值。我们称点u控制点v,如果它们之间满足如下两个条件:1)v在以u为根节点的子树中,2)从u到v的简单路径上边的权重和dist(u, v)不超过v点的权重。顶点范围2e5,权值大小1-1e9一个顶点s到它的各个祖先的距离是有序的,很容易想...

2018-09-30 13:58:15 225

原创 cf 1051F The Shortest Statement

一 原题F. The Shortest Statementtime limit per test: 4 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputYou are given a weighed undirected connected grap...

2018-09-29 14:06:43 370

原创 cf 1027f Session in BSU

一 原题F. Session in BSUtime limit per test: 4 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputPolycarp studies in Berland State University. Soon he wil...

2018-08-22 15:41:59 183

原创 cf 1027D Mouse Hunt

原题D. Mouse Hunttime limit per test: 2 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputMedicine faculty of Berland State University has just finished ...

2018-08-21 16:17:50 177

原创 cf 1012B Chemical table

一 原题D. Chemical tabletime limit per test: 1 secondmemory limit per test: 512 megabytesinput: standard inputoutput: standard outputInnopolis University scientists continue to investigate th...

2018-07-31 00:44:38 533

原创 cf 1006F Xor-Paths

一 原题F. Xor-Pathstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a rectangular grid of size n×mn×m. Each cell has a nu...

2018-07-20 19:58:48 325

原创 poj 1183 食物链

一 原题食物链Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 88372   Accepted: 26490 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中...

2018-07-18 15:54:49 150

原创 poj 2823 Sliding Window

一 原题Sliding WindowTime Limit: 12000MS Memory Limit: 65536KTotal Submissions: 68479 Accepted: 19426Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is given to you. There is a sliding window ...

2018-07-12 13:22:40 162

原创 cf 1004E Sonya and Ice Cream

一 原题E. Sonya and Ice Creamtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSonya likes ice cream very much. She eats it even during programming com...

2018-07-11 23:55:01 351

原创 cf 1004D Sonya and Matrix

一 原题D. Sonya and Matrixtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSince Sonya has just learned the basics of matrices, she decided to play wi...

2018-07-10 20:02:01 270

原创 cf 1000E We Need More Bosses

一 原题E. We Need More Bossestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYour friend is developing a computer game. He has already decided how th...

2018-07-09 16:25:36 216

原创 poj 1236 Network of Schools

一 原题Network of SchoolsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 22353 Accepted: 8786DescriptionA number of schools are connected to a computer network. Agreements have been developed a...

2018-07-08 23:28:37 112

原创 cf 997c Sky Full of Stars

一 原题E. Sky Full of Starstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn one of the planets of Solar system, in Atmosphere University, many stud...

2018-07-07 23:57:16 792

原创 cf 1000c Covered Points Count

一 原题C. Covered Points Counttime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn segments on a coordinate line; each endpoint of every ...

2018-06-28 21:08:08 646

原创 Hulu的一道面试题

一 题意给定一个整数数组a,分别求出满足下列条件的子串数量:1)子串[l, r]中的最大值为a[r];2)子串[l, r]中的最小值为a[l],最大值为a[r]注意是子串不是子序列,第一问要求O(n)的时间复杂度,第二问要求O(n*lgn)二 分析第一小问,对于a中的每个元素a[i],我们定义prev[i]:prev[i]是在a[i]之前第一个比它大的数的下标,如果没有这样的数prev[i]=-1...

2018-06-11 12:58:36 2040 4

原创 cf 985E Pencils and Boxes

一 原题E. Pencils and Boxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka received a gift of multicolored pencils for his birthday! Unfortuna...

2018-05-22 15:11:06 419

原创 cf 959D Mahmoud and Ehab and another array construction task

一 原题D. Mahmoud and Ehab and another array construction tasktime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud has an array a consisting of n ...

2018-05-20 15:02:33 247

原创 cf 982D Shark

一 原题D. Sharktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor long time scientists study the behavior of sharks. Sharks, as many other species, a...

2018-05-19 16:33:09 639

原创 cf 983B XOR-pyramid

一 原题B. XOR-pyramidtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputFor an array bb of length mm we define the function ff asf(b)={b[1]if m=1f(b[1]⊕...

2018-05-16 17:37:13 346

原创 cf 979D Kuro and GCD and XOR and SUM

一 原题D. Kuro and GCD and XOR and SUMtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputKuro is currently playing an educational game about numbers. Th...

2018-05-16 17:29:47 426

原创 cf 983A Finite or not?

一 原题A. Finite or not?time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given several queries. Each query consists of three integers pp, qq an...

2018-05-16 17:21:11 378

原创 cf 940E Cashback

一 原题E. Cashbacktime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSince you are the best Wraith King, N

2018-03-21 16:22:10 173

原创 cf 923D Picking Strings

一 原题E. Picking Stringstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice has a string consist

2018-03-15 20:25:03 194

原创 cf 923C Perfect Security

一 原题C. Perfect Securitytime limit per test3.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputAlice has a very important

2018-03-14 12:23:55 1343

原创 cf 923B Producing Snow

一 原题C. Producing Snowtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice likes snow a

2018-03-13 11:40:01 1163 1

原创 cf 949B A Leapfrog in the Array

一 原题B. A Leapfrog in the Arraytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputDima is a beginner program

2018-03-11 14:22:26 327

原创 cf 949A Zebras

一 原题A. Zebrastime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputOleg writes down the history of the days he lived. For each day he decides if it was g...

2018-03-10 19:57:51 372

原创 cf 936B Sleepy Game

一 原题B. Sleepy Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya and Vasya arranged a game. The game runs by the following rules. Players h...

2018-03-01 14:15:24 830

原创 usaco6.5.5 Checker Challenge

一 原题Checker ChallengeExamine the 6x6 checkerboard below and note that the six checkers are arranged on the board so that one and only one is placed in each row and each column, and there i

2018-02-25 12:18:22 228

原创 usaco6.5.4 The Clocks

一 原题The ClocksIOI'94 - Day 2Consider nine clocks arranged in a 3x3 array thusly:|-------| |-------| |-------| | | | | | | | |---O | |---O | |

2018-02-25 11:52:20 204

原创 usaco6.5.3 Betsy's Tour

一 原题Betsy's TourDon PieleA square township has been divided up into N2 square plots (1 <= N <= 7). The Farm is located in the upper left plot and the Market is located in the lower left plot

2018-02-25 11:16:40 481

原创 cf 933A A Twisty Movement

一 原题A. A Twisty Movementtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA dragon symbolizes wisdom, p

2018-02-17 23:27:41 569

原创 cf 919D Substring

一 原题                                                             D. Substringtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutp

2018-02-01 00:08:11 269

原创 cf 917A The Monster

一 原题C. The Monstertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs Will is stuck in the Upside Down

2018-01-31 00:18:02 423

原创 cf 915E Physical Education Lessons

一 原题E. Physical Education Lessonstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis year Alex has finished school, an...

2018-01-17 14:02:41 390

原创 usaco6.5.1 All Latin Squares

一 原题All Latin SquaresA square arrangement of numbers1 2 3 4 52 1 4 5 33 4 5 1 24 5 2 3 15 3 1 2 4is a 5 x 5 Latin Square because each whole number from 1 to 5 appears once and...

2018-01-06 18:45:44 434

空空如也

空空如也

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

TA关注的人

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