自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Nice Garland

You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi (‘R’, ‘G’ and ‘B’ — colors of lamps in the garland).You have to recolor some la...

2019-10-23 18:28:22 200

原创 C - Vitaly and Strings

Vitaly is a diligent student who never missed a lesson in his five years of studying in the university. He always does his homework on time and passes his exams in time.During the last lesson the tea...

2019-08-29 13:21:30 169

原创 B - Sinking Ship

The ship crashed into a reef and is sinking. Now the entire crew must be evacuated. All n crew members have already lined up in a row (for convenience let’s label them all from left to right with posi...

2019-08-29 13:04:33 140

原创 A - The Child and Homework

Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the chil...

2019-08-29 13:04:18 108

原创 C - Pasha and String

Pasha got a very beautiful string s for his birthday, the string consists of lowercase Latin letters. The letters in the string are numbered from 1 to |s| from left to right, where |s| is the length o...

2019-08-29 13:03:58 120

原创 D - Difference Row

You want to arrange n integers a1, a2, …, an in some order in a row. Let’s define the value of an arrangement as the sum of differences between all pairs of adjacent integers.More formally, let’s den...

2019-08-29 13:03:45 114

原创 B - 畅通工程续

某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。Input本题目包含多组数据,请处理到文件结束。每组数据第一行包含两个正整数N和M(0<N<200,0<M&l...

2019-08-29 13:03:22 139

原创 E - Magic Numbers

A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and ...

2019-08-29 12:50:37 124

原创 C - Cutting Banner

A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes place on the Miami beach. Unfortunately, the company that made the banner mixed up two orders and...

2019-08-29 12:50:23 242

原创 B - Bayan Bus

The final round of Bayan Programming Contest will be held in Tehran, and the participants will be carried around with a yellow bus. The bus has 34 passenger seats: 4 seats in the last row and 3 seats ...

2019-08-29 12:50:10 6008

原创 A - 畅通工程(并查集)

某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和道路数目M;随后的M行对应M条道路,每行给出一对正...

2019-08-29 12:49:56 54

原创 E - New Year Book Reading

New Year is coming, and Jaehyun decided to read many books during 2015, unlike this year. He has n books numbered by integers from 1 to n. The weight of the i-th (1 ≤ i ≤ n) book is wi.As Jaehyun’s h...

2019-08-29 12:49:44 61

原创 E - Fence(前缀和)

There is a fence in front of Polycarpus’s home. The fence consists of n planks of the same width which go one after another from left to right. The height of the i-th plank is hi meters, distinct plan...

2019-08-29 12:49:27 165

原创 C - Catch That Cow(广搜)

农夫知道一头牛的位置,想要抓住它。农夫和牛都于数轴上 ,农夫起始位于点 N(0<=N<=100000) ,牛位于点 K(0<=K<=100000) 。农夫有两种移动方式: 1、从 X移动到 X-1或X+1 ,每次移动花费一分钟 2、从 X移动到 2*X ,每次移动花费一分钟 假设牛没有意识到农夫的行动,站在原地不动。最少要花多少时间才能抓住牛?Input一行: 以空格分...

2019-08-29 12:49:13 196 1

原创 F - Hexadecimal's theorem

Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci n...

2019-08-29 12:48:43 179

原创 D - 24 Game

24点游戏大家应该很熟悉。通过加减乘除四则运算用四个数得到24。现在考虑一个升级版的游戏:给定1…n这n个数,通过加、减、乘这三种运算得到24。Input一个正整数n,n<=100000Output如果有解,第一行输出"YES"接下来n-1行,每行输出一个操作,形如"a op b = c" 。详情见样例。无解则输出"NO"注意:你的中间结果绝对值不得超过10^18Sampl...

2019-08-10 22:54:45 133

空空如也

空空如也

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

TA关注的人

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